Designing Contrast
Contrast is a menu bar app that Sam Soffes and I, Matt D. Smith, launched. If you haven't seen it yet, definitely check out the site or the app before reading this post, otherwise it won't make much sense.
Sam was at working from my studio for a few days during a motorcycle trip of his across the Southeast.
It was rather serendipitous how we decided to make this app. We kind of just agreed to build after like 1 minute of talking about it. We grabbed dinner the first night he was in town and brainstormed some ideas. I brought my trusty pocket-sized Field Notes journal and pen.
We were at Ted's Most Best, a place in Athens you should totally go to if you're ever in town.
"Ok, here's what I'm thinking." I told Sam as I put pen to paper. I made a quick little sketch.
This is the one and only drawing I did of the concept. It's also basically the same thing I tweeted to Brent Jackson over a year ago when I asked if he'd considered making a menu bar app out of his Colorable demo.
After discussing with Sam, he felt confident he could get a rough prototype running pretty quickly.
We went back to the studio and within literally 15 minutes or so, he had the WCAG luminance equations and native color pickers working in a rough prototype app.
I don't have a screenshot of that, but it was basically the AA rating on the left with two default mac color pickers on the right.
The Menu Bar Icon
I like to design interfaces based on moments in time—like the first time it's used versus how it will function with repeated use.
Because of this I started with the menu bar icon. The little 16px tall icon that you click on to show the app.
Here is the original design of the first icon.
My original concept was an AA icon to represent the color contrast score. Typography by it's nature is typically designed anywhere from 1200pt to 2400pt, so it's not going to be pixel perfect when scaled down to a tiny size, which doesn't work well for a tiny icon.
I redrew the primitive shapes for the tiny As and had it looking pretty decent. Sam suggested trying a contrast-type icon like you would see when editing photos.
More concepts, especially at an early stage are never a bad idea. So I got started on the second concept. After a few minutes I came up with another concept (below).
Menu bar apps need 1x, 2x, and 3x menu bar icons.
I always find it easier to design for what you're designing on so I designed for 2x first, just at a 1x scale.
I designed the small squares on the right to start on a half Y pixel so the spacing would be more vertically even on retina screens. I adjusted to a whole pixel for 1x screens, and exported my half pixel version at 3x.
You can see the subtle half pixel in the spacing below.
I went ahead and exported these for Sam to test in his prototype. I learned that the constraints for these icons aren't 16x16, they're more like 16xwhatever. You can have a custom width, so I decided to put a little padding on each side and settled on 16x20.
Somewhere along the way Sam needed to name the project inside of Xcode and asked for a name.
Without putting a ton of thought, we decided on simply Contrast since that was the most straightforward name of what we were designing for.
The App UI
Like any good drawing or painting, it helps to start with solid reference material.
Starting with Screenshots
I took several screenshots of the the colorable demo, a handful of menu bar apps I use like Cloud app, Dropbox, etc. as well as a few screenshots of the menubar itself with Sketch open.
PRO TIP: ⌘ + option + shift + 4 is your best friend for tasks like these. Hitting that key combo changes your cursor to crosshairs that allows you to click and drag an area of your screen to make a cropped screenshot. This particular key combo saves the screenshot to your temporary memory instead of saving a file. You can then ⌘ + V the screenshot into your design application of choice.
I've only designed one other Mac app and the sizing can be tricky to get right if you haven't done it much before. 12 and 13pt fonts are way more prevalent on desktop apps as opposed to websites or mobile apps. It takes some mental convincing that it's OK to use fonts that size.
The screenshots are really helpful to use for sizing reference.
Initial designs
Contextual design is always best, so I designed the initial UI directly on top of the menu bar and Sketch screenshots.
I started off by designing pretty much exactly what I had sketched a few hours earlier.
There was a part of me that wanted to over design it with a really large AAA score with lots of negative space. That's what made me love Brent's version so much after all. But that just didn't feel right for a small utility. Websites and desktop applications are two different beasts and require different approaches.
You can see some of the quick initial designs below. They're super rough, but you gotta start somewhere.
I drew a background rectangle in Sketch and rounded the corners to 6 pixels. Then a used a smaller 20x20 square shape, rotated at 45deg for the small arrow on the top. I knew I'd want to change the color of the entire app background so I merged them as one shape.
Settling on style
I kept referencing input fields on different Mac apps. Sketch has very native-feeling input fields with square edges and that seemed like a good approach to begin with.
As I kept tinkering with the designs, nudging pixels here and there, the square input fields just felt harsh for the app. Perhaps it was the round corners of the background and the close proximity of the input fields to the soft edges.
So despite my initial attempts I went with rounded input corners instead. The entire UI would have to be built custom in Xcode anyway's so rounded or not, it didn't matter much.

I encourage you to do what works for you though, and not get too caught up on exact naming conventions.
Symbol Assembly
OK, now that everything was built out, it was time to reassemble the app using symbols.
I use the Runner plugin to quickly insert symbols into my document. So any time I want to insert a symbol I can hit the quick key ⌘ + '
, tab to insert
, type the symbol name, and hit return.
I did this for every component including the background, the score, the foreground and background controls, and finally the ratio.
Now that I had the full app built with symbols, I selected everything and created another symbol out of all of the parts.
This gives me the ability to spawn a new version of the app all over the document. It's also really easy to copy and paste this one symbol into other documents as needed.
Testing for Background Color Variation
With my one symbol to rule them all built, it was time to layout a bunch of variations for stress testing the UI colors.
We planned to have a luminance if statement that would change the UI from dark to light based on the brightness value of the chosen background color. So I needed to make sure the UI wasn't going to break at any given range.
I laid out roughly 12 instances of my app/flyout
symbol.
You can see they're all the same color. Now I went back into the symbols section and created a lot more color symbols using the same color/hex
naming convention and same artboard size.
I went ahead and changed the background of every symbol making sure that I had a range of dark and light colored backgrounds.
You can see from here that some of the UI components are starting to get lost, which is where the dark/light variations will help out.
I wasn't sure of the exact brightness scale of these colors, so I used my best guess as to which one needed light versus dark UI.
PRO TIP: You can select multiple instances of the same symbol and update nested symbols for every instance at the same time.
Design Hand-off
Now that the designs were pretty much finalized, it was time to hand-off the files.
I use Dropbox exclusively for all of my digital files and have an exquisitely organized folder structure for my projects. This made it super easy (as always) to instantly share my project with Sam.
I gave a quick walkthrough on how I setup the Sketch file, how the app was built using symbols, and where he could dig into each little piece of UI to find the information he needed.
PRO TIP: It's always a good idea to talk to your developer early and often about the project you're building. This will dramatically increase the quality and speed of what you build.
It's also worth noting that I used a pretty strict 4px mental system when laying out each component, making sure that every margin was divisible by 4. This is a pretty standard goto system for me. It works well for mobile app design as well as web stuff.
The App Store Icon
Ah yes, the beloved icon. We needed this. You know, the one that shows up in the actual App Store, in the Applications folder in Finder, etc.
Even though this is exclusively a menu bar app, we still needed the icon.
I started off creating a pretty boring black icon with a larger version of the menu bar icon at first.
I knew we needed a better one eventually, but we were moving fast and I figured I'd make it better later. I mean, I made it as nice as possible for what it was, it just wasn't great.
In the end, this is what I settled on, but it was only after a big design sprint for the marketing website.
The Loupe
Another big part of this little app is the ability to select a color with a loupe-style color picker.
I wanted to be able to pick any color on the screen, the same way you can quickly select a color using CTRL + C
in Sketch.
Little did Sam know that when I mentioned this feature to him that it would be the bane of his existence.
It turns out, color spaces are pretty complex, and no wonder Sketch drew a line in the sand with the 45th version of their app.
Entering a hex code in a field is a pretty fool-proof way to get measurements, but picking a color from your screen is 10 times harder, programmatically speaking anyways.
There were issues with the mouse leaving the loupe behind, then issues with wrong HEX codes getting picked during simple color tests.
Finally, after doing things with code that I could only hope my great grandchildren would do, Sam fixed everything with the color picker loupe.
There are still color space issues, but that's more of a general color issue at large rather than a bug in the app. For example the hex codes may be slightly off if used in Photoshop, unless you choose Display
from color profiles.
But all other tests in Sketch, Figma, Illustrator, and XD passed with flying colors. Pun intended.
Hooray for colors!
The Sliders
So in Brent Jackson's colorable demo, he's got these nifty little HSB sliders. Hue, Saturation, and Brightness. I find myself using the brightness slider the most to tweak and color just above a passing score from time to time.
And because the goal of this app is to stay tiny and out of the way, we decided it would be nice to have a brightness slider, but just leave the other ones out.
Before launching we decided that this would be better as a later feature. It's not critical for functionality and we did add the arrow key nudge up/down feature, which is almost better in my opinion.
Always best to draw a line in the sand somewhere so you can actually ship the product.
Mo' Testing Mo' Features
The feature ideas really don't stop. It's like a water hose. As soon as I started testing builds of the app and using during actual design projects, I found myself wanting to swap the background and foreground colors.
"I'll just design a little icon for that!" I thought to myself. So I did. Introducing the color swapper button.
My gut said it would be less time consuming than some of our other ideas, so Sam graciously popped it in real quick. Thanks, Sam!
Sound FX
Back in the day I was OBSESSED with little clicks and pops in Flash websites. I had a huge library of sounds that I completely abused in all of my old and horribly awesome websites.
So when I saw that Glyphish released some pretty amazing sound effects, it rekindled my love for aptly placed sound within an interface.
Sidenote: Have you ever noticed how amazing the Facebook sound effects are? I don't see many people talking about sound in UI. Weird? It's an amazing way to add polish to your software.
I bought them and put them in our shared Dropbox folder for Sam to have some fun with. We bounced some ideas back and forth, tested a few out, and ultimately settled on a few little bips and boops all in the name of fun.
Download the App
Speaking of fun, you should totally go snag this app! We think it's pretty awesome and had a blast making it.
If you're making interfaces in any form or fashion this app was built for you. Designer? Developer? QA person? Yes you.
You can test the color contrast on design mockups, actual websites, keynote presentations, and anything else that's designed on a Mac.
Still reading this? Go get the app!
This was published originally at http://mds.is/designing-contrast.com
Very cool article and a great app! Thank you for this awesome outline of the events. I’m glad to hear you thinking in some ‘units’ like the 4px you mentioned. So many designers I work with couldn’t explain their reasoning. I write my CSS with a variable called ‘$pad’ that helps me keep that connection: https://codepen.io/sheriffderek/pen/LjdzeQ - thanks again for this. : )
Thanks! Glad you liked it.