FastLED 3.9.15
Loading...
Searching...
No Matches
hsv16.h
Go to the documentation of this file.
1#pragma once
2
3#include "fl/stdint.h"
4#include "fl/int.h"
5#include "crgb.h"
6#include "fl/ease.h"
7
8namespace fl {
9
10struct HSV16 {
11 u16 h = 0;
12 u16 s = 0;
13 u16 v = 0;
14
15 HSV16() = default;
16 HSV16(u16 h, u16 s, u16 v) : h(h), s(s), v(v) {}
17 HSV16(const CRGB& rgb);
18
19 // Rule of 5 for POD data
20 HSV16(const HSV16 &other) = default;
21 HSV16 &operator=(const HSV16 &other) = default;
22 HSV16(HSV16 &&other) noexcept = default;
23 HSV16 &operator=(HSV16 &&other) noexcept = default;
24
25 CRGB ToRGB() const;
26
29 operator CRGB() const { return ToRGB(); }
30
31 // Are you using WS2812 (or other RGB8 LEDS) to display video?
32 // decimate the color? Use colorBoost() to boost the saturation.
33 // This works great for WS2812 and any other RGB8 LEDs.
34 // Default saturation function is similar to gamma correction.
35 CRGB colorBoost(EaseType saturation_function = EASE_IN_QUAD, EaseType luminance_function = EASE_NONE) const;
36};
37
38} // namespace fl
Defines the red, green, and blue (RGB) pixel struct.
EaseType
Definition ease.h:21
@ EASE_NONE
Definition ease.h:22
@ EASE_IN_QUAD
Definition ease.h:23
IMPORTANT!
Definition crgb.h:20
Representation of an RGB pixel (Red, Green, Blue)
Definition crgb.h:86
HSV16 & operator=(const HSV16 &other)=default
CRGB colorBoost(EaseType saturation_function=EASE_IN_QUAD, EaseType luminance_function=EASE_NONE) const
Definition hsv16.cpp:181
HSV16()=default
HSV16(const HSV16 &other)=default
u16 v
Definition hsv16.h:13
CRGB ToRGB() const
Definition hsv16.cpp:177
HSV16(HSV16 &&other) noexcept=default
u16 h
Definition hsv16.h:11
u16 s
Definition hsv16.h:12
HSV16(u16 h, u16 s, u16 v)
Definition hsv16.h:16
HSV16 & operator=(HSV16 &&other) noexcept=default