Class Colors¶
Defined in File colors.h
Class Documentation¶
-
class
Colors
¶ Public Types
-
enum
MixMode
¶ Determines the blending algorithm used when mixing two colors.
Values:
-
None
¶ Do not mix the colors.
-
Alpha
¶ Mixes both colors with a specific blend percentage (blending is applied to the Layer).
-
Multiply
¶ Multiplies the base color by the layered color.
-
Overlay
¶ Only draws the layered color if it’s not black. Black pixels are rendered transparent.
-
Public Static Functions
-
void
generate_comet
(RGB *array, uint8_t array_size, RGB &start_color, RGB &end_color, uint8_t comet_start, uint8_t comet_length)¶ Generates a comet with a tail.
- Parameters
array
: The array to populate.array_size
: The size of the array.body_color
: The color of the comet’s body.tail_color
: The color that the comet fades to.comet_start
: How far the comet body is from the start of the array.comet_length
: The length of the comet from body to tail.
-
void
generate_random_color_array
(RGB *array, uint8_t num_colors)¶ Creates a randomly generated array of colors.
- Parameters
array
: The array to populate.num_colors
: The number of colors to generate.
-
void
generate_scaling_color_array
(RGB *array, RGB &base_color, RGB &target_color, uint8_t num_colors, bool mirror = false)¶ Creates an array of colors that gradually blend from a base color to a target color.
- Parameters
array
: The array to populate.base_color
: The initial color.target_color
: The target color.num_colors
: Number of colors in the array.mirror
: If true, the array will be mirrored from the target color back to the base color.
-
Colors::RGB
mix_colors
(const RGB &color_one, const RGB &color_two, MixMode mode, uint8_t alpha = 0)¶ Mixes two colors.
- Return
The mixed color.
- Parameters
color_one
: The first color to mix.color_two
: The second color to mix.mode
: The type of mixing to perform.alpha
: Color two alpha factor (0 - 255).
-
enum