mirror of
https://github.com/Makuna/NeoPixelBus.git
synced 2025-08-10 14:24:26 +02:00
Updated HsbColor object API (markdown)
@@ -22,13 +22,14 @@ 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.
|
CAUTION: The H,S,B members are not initialized and may not be consistent until set.
|
||||||
|
|
||||||
## Methods
|
## Methods
|
||||||
### static HsbColor LinearBlend(HsbColor left, HsbColor right, float progress);
|
### template \<typename T_NEOHUEBLEND\> static HsbColor LinearBlend(HsbColor left, HsbColor right, float progress)
|
||||||
This will blend between two colors by the amount defined by the progress variable.
|
This will blend between two colors by the amount defined by the progress variable.
|
||||||
|
T_NEOHUEBLEND - [a NeoHueBlend object](https://github.com/Makuna/NeoPixelBus/wiki/NeoHueBlend-objects), that will define how the colors are blended.
|
||||||
left - the color to start the blend at.
|
left - the color to start the blend at.
|
||||||
right - the color to end 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.
|
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...
|
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);
|
HsbColor results = HsbColor::LinearBlend<NeoHueBlendShortestDistance>(HsbColor(0.88f,1.0f,1.0f), HsbColor(0.12f,1.0f,1.0f), 0.33f);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user