The Technicalities of Color
When we create graphics like data visualizations, color choice is one way we can impactfully communicate our insights. On the surface, colors might look deceivingly easy, but there's incredible science behind how they work.
Color Models (RGB and CMYK)
For those who create visuals in Excel, Power BI, Python, or R (to name a few), you're probably already familiar with the color options that we can easily select from or insert directly as parameters into our code. Instead of talking about the creative color names available in the Python or R color palettes in this newsletter, we're going to talk instead about how colors work behind the scenes. There are two common color models that designers use: RGB and CMYK.
RGB
The acronym RGB stands for Red-Green-Blue. We commonly see this additive color model in digital design where the screen is black unless we add colors to it. We see white on the screen when the RGB color model combines all the primary colors together. Each of the color values for red, green, and blue in the RGB model range from 0 to 255. The single color we see depends on the combination of each of these values.
Notice the combination of RGB values it takes to create the ten default Excel colors plus white and black. We can also see that white has RGB values of 255 across the board, while the values for black are all 0 because it represents the absence of light.
We'll often see RGB colors denoted by hex values, which represent shorthand notation of RGB values in hexadecimal format.
For each Power BI model that I develop and ultimately publish, I'm very mindful of the colors I choose to use it in. I'll often extract colors from an organization's logo for example using the color tools available online through Adobe. One way to save the hex value color selections to use in multiple Power BI models is by creating a report theme to import directly into Power BI, which I cover in the video below in my Data Dashboards for Power BI course in the LinkedIn Learning library.
领英推荐
CMYK
The acronym CMYK stands for Cyan-Magenta-Yellow-Key, where Key typically displays as black. We often see this color model in printed design materials because it's a subtractive model where white represents the color of the paper in the background, where we see black when we combine all the colors together. Because I work mostly in the digital space with data science and business intelligence models that others normally view on a screen, I typically use the RGB color model, but I think it's fascinating to think about both these common color models in the context of each other.
Here's how to estimate the conversion of Excel colors from hex values to RGB to CMYK. Notice that while the Key value (represented as black) is the last letter in the acronym, it's actually the first percentage we calculate in converting the RGB color model to CMYK. We can then calculate the cyan, magenta, and yellow percentages once we know the black percentage in the CMYK color model.
Color Blindness
The human eye sees color in a way that's much like the RGB color model. The eye has three cones that serve as photoreceptor cells in the retina to see different wavelengths of light. The short (S), medium (M), and long (L) cones respond to colors depending on their wavelength as we can see below.
User accessibility in technology is an important topic that's finally getting the traction it deserves and needs in discussions about products that so many people use. We want to make our work useful for not only us, but others who might be end users of the work we do. One way to improve user accessibility is by choosing colors that account for color blindness, a condition which impacts an estimated 5-10% of the population.
We can see that with normal vision, there's minimal overlap between the red and green cones in the eye. The most common kind of color blindness is the inability to distinguish between red and green because there's a significant overlap between the red and green cones.
Those with color blindness might see brown instead of distinct shades of green and red, which means these two colors can cause problems if we use them together in the same visual. So, what colors will work then? We can take the colors we want to use and see what they look like to those with color blindness as a starting point. Using the same default Excel colors, we can see that while green and red can pose problems for color user accessibility, blue and orange look pretty different for almost all types of color blindness. My own default choice of colors (especially for a color scale) is orange, blue, and gray.
Color models and color user accessibility are two topics within the vast and fascinating space of how colors work. I'm looking forward to learning more about colors when I get a chance to read Color Appearance Models by Mark Fairchild.
I'm excited to share that my Power BI Weekly series comes out tomorrow with a new video coming out each week on Thursday. First up in the series: how to properly account for Daylight Savings Time in Power BI models. I'll post the video when it comes out and also share it in next week's newsletter - stay tuned!
-HW
LinkedIn [in]structor | Data Science Consulting
2 年Update: I added another graphic to this newsletter edition for the calculations of the hex values from RGB!
Manager Financial Planning | Analyzing Financial Performance | Identifying Cost Saving Opportunities | Collaborative Problem Solver | Passionate about Driving Effciency & Growth
2 年Very interesting!
Head of Operations and Corporate Investment | Ingeniería eléctrica y electrónica
2 年I have to be honest, I have been waiting this haha like for a year. Thank you so much this Is extremely helpful and I love to read your content, it has helped me a lot ??
Visio expert | Business process consultant | Dynamic speaker and instructor | LinkedIn Learning Instructor | Book author | Educator at heart
2 年Courtesy of a referral from my nephew who is a UX designer, I've been using Adobe's accessible color palette generator https://color.adobe.com/create/color-accessibility. It lets you generate palettes of five colors that are differentiable for people with the three most common types of color blindness. And it's kind of fun to play with!