Buttery Smooth Fades with the Power of HSV

In firmware-land we usually refer to colors using RGB. This is intuitively pleasing with a little background on color theory and an understanding of how multicolor LEDs work. Most of the colorful LEDs we are use not actually a single diode. They are red, green, and blue diodes shoved together in tight quarters. (Though interestingly very high end LEDs use even more colors than that, but that’s a topic for another article.) When all three light up at once the emitted light munges together into a single color which your brain perceives. Appropriately the schematic symbol for an RGB LED without an onboard controller typically depicts three discrete LEDs all together. So it’s clear why representing an RGB LED in code as three individual values {R, G, B} makes sense. But binding our representation of color in firmware to the physical system we accidentally limit ourselves.

The inside of an RGB LED

Last time we talked about color spaces, we learned about different ways to represent color spatially. The key insight was that these models called color spaces could be used to represent the same colors using different groups of values. And in fact that the grouped values themselves could be used to describe multidimensional spacial coordinates. But that post was missing the punchline. “So what if you can represent colors in a cylinder!” I hear you cry. “Why do I care?” Well, it turns out that using colorspace can make some common firmware tasks easier. Follow on to learn how!

Continue reading “Buttery Smooth Fades with the Power of HSV”

Color Spaces: The Model at the End of the Rainbow

When I learned about colors in grade school everything started with red, yellow, and blue and getting fancier colors was easy. I mixed some blue into my yellow to get green, or into red to get purple, and so on. After painting enough terrifying “art” for my parents, this made intuitive sense. That is until my mind was blown by the revelation that this wasn’t always true! 

To make the same colors with light instead of paint I had to use red, green, and blue, not yellow. It was until much later when trying harness banks of RGB LEDs that this knowledge became useful. I was struggling to make my rogue diodes look quite the way I wanted when I stumbled into the realization that maybe there was another approach. What did the numbers representing R G and B actually mean? Why those parameters? Could there be others? [Elliot Williams] has written about the importance of gamma correction and adjustment for human perception of color, but we can ask a more fundamental question. Why do we represent color this way at all?

Continue reading “Color Spaces: The Model at the End of the Rainbow”

A Hypnotizing Interactive Art Piece for Visualizing Color Theory

Digital color theory can be a tricky concept to wrap one’s mind around – particularly if you don’t have experience with digital art. The RGB color model is about as straightforward as digital color mixing gets: you simply set the intensity of red, green, and blue individually. The result is the mixing of the three colors, based on their individual intensity and the combined wavelength of all three. However, this still isn’t nearly as intuitive as mixing paint together like you did in elementary school.

To make RGB color theory more tangible, [Tore Knudsen and Justin Daneman] set out to build a system for mixing digital colors in a way that reflects physical paint mixing. Their creation uses three water-filled containers (one each for red, green, and blue) to adjust the color on the screen. The intensity of each color is increased by pouring more water into the corresponding container, and decreased by removing water with a syringe.

An Arduino is used to detect the water levels, and controls what the user sees on the screen. In one mode, the user can experiment with how the color levels affect the way a picture looks. The game mode is even more interesting, with the goal being to mix colors to match a randomly chosen color that is displayed on the screen.

The practical applications for this project may be somewhat limited, but as an interactive art piece it’s hypnotizing. And, it may just help you with understanding RGB colors for your next project.

Continue reading “A Hypnotizing Interactive Art Piece for Visualizing Color Theory”