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