Sam Freeman is an Online Editor at Make. He builds interactive art, collects retro tech, and tries to get robots to make things for him. Learn more at samtastic.co, or on socials @samdiyfreeman.
This article appeared in Make: Vol. 96. Subscribe to Make: for the latest articles.
“I use either FastLED or Pixelblaze in my projects including my Fibonacci256 (above), and they both support color palettes. In fact I worked with Ben Hencke of ElectroMage to get color palettes added to Pixelblaze, although he definitely did all of the hard work. And all credit to the brilliant Mark Kriegsman and the late Dan Garcia who added excellent support for color palettes to FastLED.” —Jason Coon, Evil Genius Labs
RGB LED projects are full of rainbow animations — it’s the “hello world” of addressable pixel strips. But if you refine your palette you can create a far more impactful, more memorable effect. Here’s how to level up the hues on your LED projects.
Mixing
Fibonacci256 Expanding HDR by Evil Genius Labs.
Your single RGB LED is made up of red, green, and blue emitters. So if you set it to a single color (like blue), you’ll get a very pure, acidic-looking blue. It’s kind of harsh and kind of boring — the same color as the indicator light on your router. The laziest way to zhuzh up your project and give it some pizzazz is by just mixing two colors together. As soon as you add a little bit of red in there, you’ve got a purple-y color that’s more interesting and unique. The blended primaries tone down the neon acidity.
Less IS More
Human eyes perceive light logarithmically; we can discern tiny increases in dim light, but the same increases in bright light are imperceptible. So if you’re mixing colors, a small difference in that tiny bit of red will look drastic. Going from full 255 intensity to 254 is pretty much impossible to notice, but at the low end it’s the difference between night and day.
So what colors should you choose? Rainbow works great for rainbow-colored costumes. But there are a million other motifs to choose from. Cool tones like blues create a calming vibe or a futuristic atmosphere. Warm colors like reds, oranges, and ambers demand attention, or evoke lanterns and campfires (use them to accent a steampunk project without looking out of place).
For powerful yet harmonious pop, throw complementary colors together, like oranges with blues. For something more subdued, stick to analogous colors that are close together on the color wheel.
How to Implement Palettes
Screenshot of PixelBlaze UI.
You can always hand-code your RGB values from 0 to 255, but this is where good software can save you a lot of time. The FastLED library for Arduino (fastled.io) and Adafruit’s CircuitPython LED library have color names built-in. So in FastLED you can type color::goldenrod and boom — you have goldenrod. It’s even easier in WLED (kno.wled.ge) where you can just tap primary and secondary colors in the app.
PixelBlaze (electromage.com) stocks excellent starter animations, including some of the best fire effects I’ve seen, plus there are tons more user-created effects. You can experiment with changes in the editor and preview the results immediately.
WLED and FastLED both have demo palettes with great examples of colors that work well together. (See Lee Wilkins’s project on page 88 ofMake: Volume 96 for more on WLED.)
Make It Yours
Evil Genius Labs Chameleon.
All these presets are fine, but you should think about them as a starting point, to avoid showing up at the party wearing the same code as someone else (speaking for a friend).
You’ve put so much work into your LED hardware, but spending just a little more time choosing your palette in software will really make it dazzle.
Sam Freeman is an Online Editor at Make. He builds interactive art, collects retro tech, and tries to get robots to make things for him. Learn more at samtastic.co, or on socials @samdiyfreeman.