mirror of
https://github.com/Makuna/NeoPixelBus.git
synced 2025-08-07 12:54:26 +02:00
Created Color objects (markdown)
20
Color-objects.md
Normal file
20
Color-objects.md
Normal file
@@ -0,0 +1,20 @@
|
||||
There are several color objects that can be used to define and blend colors. While all can be directly used to set the pixel color, the RgbwColor can only be used with a NeoPixelBus that has been declared with NeoRgbwFeature or a compile error will be given.
|
||||
|
||||
# RgbColor object
|
||||
This represents a color as RGB model and exposes useful methods to manipulate colors. This is the native color used and is the most efficient.
|
||||
The color components are Red, Green, and Blue.
|
||||
|
||||
# RgbwColor object
|
||||
This represents a color as RGBW model and exposes useful methods to manipulate colors. This is the native color used and is the most efficient with a NeoPixelBus defined wit NeoRgbwFeature.
|
||||
The color components are Red, Green, Blue, and White.
|
||||
This can only be used with NeoPixelBus that was declared with a four element color feature like NeoRgbwFeature.
|
||||
|
||||
# HslColor object
|
||||
This represents a color as a HSL model and exposes useful methods to manipulate colors. While not the native color used, the extra overhead will be offset by intuitive color components and effects.
|
||||
The color components are Hue, Saturation, and Lightness, all in the range of 0.0 to 1.0.
|
||||
To darken the color, just reduce the L property. To brighten the color, just increase the L property. A normal range for L is from 0.0f to 0.5f when Saturation is set to 1.0f.
|
||||
To randomly pick a full bright color, just randomly pick a Hue and set Saturation at 1.0f and Lightness to 0.5f.
|
||||
|
||||
# HsbColor object
|
||||
This represents a color as a HSL model and exposes useful methods to manipulate colors. While not the native color used, the extra overhead will be offset by intuitive color components and effects.
|
||||
This is included for completeness for those who are given code that uses this older format.
|
Reference in New Issue
Block a user