mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-12-16 01:48:56 +08:00
Add coverage for colors (extended) (#385)
This commit is contained in:
committed by
ArthurSonzogni
parent
04b36df567
commit
06ed8567b8
@@ -170,7 +170,8 @@ Color Color::HSV(uint8_t h, uint8_t s, uint8_t v) {
|
||||
|
||||
// static
|
||||
Color Color::Interpolate(float t, const Color& a, const Color& b) {
|
||||
if (a.type_ == ColorType::Palette1) {
|
||||
if (a.type_ == ColorType::Palette1 || //
|
||||
b.type_ == ColorType::Palette1) {
|
||||
if (t < 0.5F) { // NOLINT
|
||||
return a;
|
||||
} else {
|
||||
@@ -178,14 +179,6 @@ Color Color::Interpolate(float t, const Color& a, const Color& b) {
|
||||
}
|
||||
}
|
||||
|
||||
if (b.type_ == ColorType::Palette1) {
|
||||
if (t > 0.5F) { // NOLINT
|
||||
return a;
|
||||
} else {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
|
||||
auto get_color = [](const Color& color, //
|
||||
uint8_t* red, uint8_t* green, uint8_t* blue) {
|
||||
switch (color.type_) {
|
||||
|
||||
Reference in New Issue
Block a user