mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-07-25 22:01:14 +08:00
Fix Color::HSV(h,0,v)
There was a problem when v==0
This commit is contained in:
parent
43cf8e7a94
commit
67984b2afd
@ -148,10 +148,6 @@ Color Color::RGB(uint8_t red, uint8_t green, uint8_t blue) {
|
|||||||
/// @ingroup screen
|
/// @ingroup screen
|
||||||
// static
|
// static
|
||||||
Color Color::HSV(uint8_t h, uint8_t s, uint8_t v) {
|
Color Color::HSV(uint8_t h, uint8_t s, uint8_t v) {
|
||||||
if (s == 0) {
|
|
||||||
return {0, 0, 0};
|
|
||||||
}
|
|
||||||
|
|
||||||
uint8_t region = h / 43; // NOLINT
|
uint8_t region = h / 43; // NOLINT
|
||||||
uint8_t remainder = (h - (region * 43)) * 6; // NOLINT
|
uint8_t remainder = (h - (region * 43)) * 6; // NOLINT
|
||||||
uint8_t p = (v * (255 - s)) >> 8; // NOLINT
|
uint8_t p = (v * (255 - s)) >> 8; // NOLINT
|
||||||
|
Loading…
Reference in New Issue
Block a user