It’s often said that the 2 hardest problems in Computer Science are:
- Naming things
- Cache invalidation
- Off-by-one errors
The problem I want to focus on is naming things, specifically colors.
I’ve frequently seen colors named like this:
red3. Basically, there are three different shades of red. The names alone don’t differentiate between them.
Other projects will name colors slightly better, ex.
evenDarkerRed. This naming convention tells you how the color relate to each other. It sadly breaks down if there are too many similar colors.
The solution is to use more specific names, ex.
scarlet. The challenge is that most people can’t correctly identify fuchsia (let alone spell it).
To remove human judgement, I’ve been using a tool intended for the color blind. You just enter the RGB value of the color, and it gives you the closest color name. A quick search reveals other, similar tools.
Different tools report slightly different colors. Find one you like and stick with it. This ensures consistency and removes ambiguity. Your team will thank you.