This commit is contained in:
2025-10-19 22:01:31 +02:00
parent 16306f2325
commit 2b4523d644
101 changed files with 2058 additions and 1564 deletions
+4 -4
View File
@@ -43,7 +43,7 @@ auto Color::fromHex(const std::string& hex_str) -> Color {
}
// Implementaciones de métodos estáticos de Color
constexpr auto Color::rgbToHsv(Color color) -> HSV {
constexpr auto Color::RGB_TO_HSV(Color color) -> HSV {
float r = color.r / 255.0F;
float g = color.g / 255.0F;
float b = color.b / 255.0F;
@@ -73,7 +73,7 @@ constexpr auto Color::rgbToHsv(Color color) -> HSV {
return {.h = h, .s = s, .v = v};
}
constexpr auto Color::hsvToRgb(HSV hsv) -> Color {
constexpr auto Color::HSV_TO_RGB(HSV hsv) -> Color {
float c = hsv.v * hsv.s;
float x = c * (1 - std::abs(std::fmod(hsv.h / 60.0F, 2) - 1));
float m = hsv.v - c;
@@ -133,7 +133,7 @@ auto getColorLikeKnightRider(const std::vector<Color>& colors, int counter) -> C
auto generateMirroredCycle(Color base, ColorCycleStyle style) -> Cycle {
Cycle result{};
HSV base_hsv = Color::rgbToHsv(base);
HSV base_hsv = Color::RGB_TO_HSV(base);
for (size_t i = 0; i < CYCLE_SIZE; ++i) {
float t = static_cast<float>(i) / (CYCLE_SIZE - 1); // 0 → 1
@@ -176,7 +176,7 @@ auto generateMirroredCycle(Color base, ColorCycleStyle style) -> Cycle {
.s = fminf(1.0F, fmaxf(0.0F, base_hsv.s + sat_shift)),
.v = fminf(1.0F, fmaxf(0.0F, base_hsv.v + val_shift))};
Color c = Color::hsvToRgb(adjusted);
Color c = Color::HSV_TO_RGB(adjusted);
result[i] = c;
result[(2 * CYCLE_SIZE) - 1 - i] = c; // espejo
}