Picking Non Random Colours for the UI

I think we are up to Part 9 of our often interrupted feature posts on the building of our new human resources SaaS app HR Partner.  I've lost count a little bit, but today I wanted to talk about one of the design issues we came across when creating the dashboard.

We love using the little pie charts from chartJS to show the relative breakdowns of male/female employees, or distribution across departments and employment statuses.  The issue was, we didn't know how to best create a colour palette for the pie segments.  You see, our users can have anything from one to many dozens of pie slices, depending on their organisation and operating requirements.

For this reason, we didn't want to create a set number of colours in our palette, mainly in case our customers exceeded this limit.  We also didn't want to generate totally random segment colours each time the chart was generated because I believe that a part of a good UX is consistency, i.e. if a customer is used to seeing light blue for the department 'Finance', then seeing it as a dark red next time can throw them off.

Additionally, one of the big features of HR Partner is that HR consultants may work across completely different company entities on a day to day basis, and it would be nice if the Finance department in one company dashboard was the same colour as the Finance department in a totally separate company.

For that reason, we decided to set the segment colours based on the segment names.  So the name 'Finance' would generate the same colour on ANY company.

Our first efforts at this resulted in some quite garish colour choices which was not pleasing at all, so in the end I decided that we would try and restrict the colours to lighter pastel hues that wouldn't clash too much, but still be fairly easy to discern.

Secondly, I also realised that because our algorithm was only taking the first 6 characters of the name, there could be collisions with similar department or employment statuses (e.g. 'Part time' and 'Part time permanent' would result in the same colour).  I also wanted similar sounding names (like 'Finance' and 'Final') to generate colours that were not too similar to each other, so I decided to do a simple MD5 hash on the name to generate a semi unique hash upon which to generate the colour.  

Here is the Ruby helper method that we use to create the colour for the view.  It simply takes a text seed string, and generates a CSS hexadecimal code for the colour.

def get_pastel_colour(seed)
  # Generate a pleasing pastel colour from a fixed string seed
  colrstr = Digest::MD5.hexdigest(seed)[0..5]
  red = ((colrstr[0..1].to_i(16).to_f / 255) * 127).to_i + 127
  green = ((colrstr[2..3].to_i(16).to_f / 255) * 127).to_i + 127
  blue =((colrstr[4..5].to_i(16).to_f / 255) * 127).to_i + 127
  "#" + "%02X" % red + "%02X" % green + "%02X" % blue
end

 

I think it ended up quite pleasing to the eye. We ended up using the same code to generate the colour within the calendars too, to get consistency with respect to leave categories.

 

I'd love to hear from other developers on how to improve on this so the colours can be a little brighter and stand out from each other a little more.

Disclaimer: Not saying we were the first to ever 'invent' this method, but there wasn't a lot that I could find on Google, so I thought I would post here in the hopes that it might help someone else who needed something similar.  The code above is based on something I found on StackOverflow, but I cannot find it again now to post proper attribution.

 

Back to recording again

Last month I had a major reorganisation in my home office/studio.  I moved my MacBook Pro to the downstair office and swapped my Windows PC to my upstairs alcove studio.  I had always used my MacBook as my primary recording platform, but the upstair studio was becoming too hot and noisy and we had just installed a brand new air conditioner in the downstairs office that I wanted to take advantage of.

Over on the left for work, over on the right for play!

Over on the left for work, over on the right for play!

So this is the first recording in the new space, and I like to say that it was MUCH more enjoyable in the cool and (relative) quiet compared to the old space.  Still need to do some work on reducing reflections etc., but overall, I think it is positive.

I still need to bring my KRK studio monitors and set them up downstairs, so at the moment I am doing all mixing and mastering using my Sennheiser HD 25-SPII headphones, which is not ideal, but all I have to work with at the moment.

My fancy stereo ribbon mic still hasn't been used in anger yet - not at least until I get a 4 channel audio interface, so I used my trusty Rode NT1-A mic blended with the internal AP5 pickup in my venerable old Maton guitar.

This piece is called 'Dandelion' and is by Masaaki Kishibe.  I've actually been playing it for a couple of years now, and it turns out to be my wife's favourite of all the instrumental pieces I play.  It is a fairly simple song, but to capture that lilting feel is a bit tricky.  I don't think I have mastered it yet, but will keep working on it.  It doesn't help that I haven't played fingerstyle guitar for so long that my fingers are still not as nimble as I would like.

I mastered this track using the Slate Virtual Mix Rack plugins - nice, but a bit of a drain on the resources on my 7 year old MacBook.  I am not completely happy with it as I think the final results are still to strident.  I need to reduce some of the high frequency and bring in more bass without making it too boomy or woofy.  It is all a learning process, and I think once I have my KRK monitors set up for mastering work, I can improve on it.

 

Who exactly is 'excited' by your latest release?

I've seen it on tons of blogs, tweets and posts... "XYZ is so excited to announce the release of our new feature on our app...".  Heck, I've done the same with my own apps too, so I am just as guilty as anyone else.

But lets face it.  It is usually only the authors, designers and developers that get excited.  And why not? We spent hours/days/weeks building code from scratch, overcoming seemingly unsurmountable technical problems, tweaking, perfecting and polishing.  Of course we will be as excited as new parents are, to release our baby into the wild and get some validation for all that effort.

But consider the user's perspective.  Is 'excited' really the right word for them?  We actually asked a select group of our users over time, and I think the more apt emotion would be 'interested', followed closely by 'apprehensive', or 'doubt'.

You see - as the builder, you have already envisaged what your new features will be used for.  What they can achieve.  How they can be used for the betterment of humankind.  And that is great. You have it all road mapped in your mind.

But most of this takes place behind closed doors, with little or no buy in by the user.  Which is probably as it should be, if you want to focus on maximising your effort and minimising distractions.  After all, no one wants a horse designed by a committee.

What your users eventually see is something new that they have to learn.  Possibly it might be a thing that they could use, but then they wonder if they have the time to learn it and make it fit with their day to day operations.  Will they have to change the way they do things in order to make best use of it?

So perhaps we need to change the way we word new product or new feature announcements.  I certainly intend to do so moving forward.  What would be the best word choice?  Is 'proud' a better way to announce something new?  How do we get 'buy in' from the user to that they feel like they are a part of the journey, rather than just some surprised passer by who has to reel back when developers jump out of dark doorways and say "Boo, I'm so excited about this..."?

I look forward to your thoughts and ideas.

 

Errors don't have to be boring

This is part 7 in the chronicles of building HR Partner, our latest web app.

A short one today.  I was designing the 404 and 500 error screens for our Ruby framework, and decided to go outside the box a little.

Usually, the 404 error page is a fairly boring affair, telling the user that they have tried to load an invalid page.  I thought to make it more interesting, I would incorporate an ever changing background for the error pages.

I am using a dynamic CSS background for the error pages, which links to unsplash.it to load up a random grayscale image as the background.

This way, every time that a user hits an error page, they will still get the large '404' or '500' error number, but overlaid on a different background each time.  I have no control over what image gets shown, but I find myself just hitting invalid pages every now and then during my development routine - just to see what pretty landscapes show up.

The body style tag looks something like the following:

<body class='black-bg' style='height: 100%; background:url(https://unsplash.it/g/1000/800/?random) no-repeat fixed center center;'>
  ... rest of 404 error info
</body>

So as I said - error message certainly do not have to be boring!