mirror of
https://github.com/Makuna/NeoPixelBus.git
synced 2025-08-09 13:54:26 +02:00
Created HsbColor object API (markdown)
34
HsbColor-object-API.md
Normal file
34
HsbColor-object-API.md
Normal file
@@ -0,0 +1,34 @@
|
||||
HsbColor represents a color object that is represented by Hue, Saturation, Brightness component values. The primary use of this class is for easy definitions of color.
|
||||
|
||||
## Properties
|
||||
There are three properties that represent the component values Hue, Saturation, and Brightness. The values range from 0.0f to 1.0f.
|
||||
H is the primary color component and represents a color wheel. Often you will see examples of this being between 0 and 360, but this library it is between 0.0f and 1.0f inclusive.
|
||||
|
||||
```
|
||||
float H;
|
||||
float S;
|
||||
float B;
|
||||
```
|
||||
## Constructors
|
||||
|
||||
### HsbColor(float h, float s, float b) :
|
||||
Constructs a HsbColor using Hue, Saturation, and Brightness color component values.
|
||||
|
||||
### HsbColor(RgbColor color);
|
||||
Construct a HsbColor using RgbColor, converting the Rgb to Hsb
|
||||
|
||||
### HsbColor()
|
||||
Construct a HsbColor that will have its values set in latter operations.
|
||||
CAUTION: The H,S,B members are not initialized and may not be consistent until set.
|
||||
|
||||
## Methods
|
||||
### static HsbColor LinearBlend(HsbColor left, HsbColor right, float progress);
|
||||
This will blend between two colors by the amount defined by the progress variable.
|
||||
left - the color to start the blend at.
|
||||
right - the color to end the blend at.
|
||||
progress - (0.0f - 1.0f) value where 0.0f will return left and 1.0f will return right and a value between will blend the color weighted linearly between them.
|
||||
This is a static function, which means you need to call it scoped to the object class and not an instance like...
|
||||
```
|
||||
HsbColor results = HsbColor::LinearBlend(HsbColor(0.88f,1.0f,1.0f), HsbColor(0.12f,1.0f,1.0f), 0.33f);
|
||||
```
|
||||
|
Reference in New Issue
Block a user