Minor tweaks.

This commit is contained in:
Blaz Kristan 2021-08-24 23:33:41 +02:00
parent 84d0c17c4b
commit 81bafa00ac
3 changed files with 716 additions and 721 deletions

View File

@ -47,10 +47,8 @@ void relativeChangeWhite(int8_t amount, byte lowerBoundary)
col[3] = new_val;
}
void colorHSVtoRGB(float hue, float saturation, float value, byte& red, byte& green, byte& blue)
void colorHSVtoRGB(float hue, float saturation, float value, byte& r, byte& g, byte& b)
{
float r = red, g = green, b = blue;
uint8_t i = hue * 6.0;
float f = hue * 6.0 - i;
value *= 255.0;
@ -66,10 +64,6 @@ void colorHSVtoRGB(float hue, float saturation, float value, byte& red, byte& gr
case 4: r = t, g = p, b = value; break;
case 5: r = value, g = p, b = q; break;
}
red = r;
green = g;
blue = b;
}
void colorRGBtoHSV(byte red, byte green, byte blue, float& hue, float& saturation, float& value)
@ -100,7 +94,7 @@ void colorRGBtoHSV(byte red, byte green, byte blue, float& hue, float& saturatio
//this feature might cause slowdowns with large LED counts
void correctColors(byte r, byte g, byte b, byte* rgb) {
float hsv[3] = { 0,0,0 };
colorRGBtoHSV(r, g,b , hsv[0], hsv[1], hsv[2]);
colorRGBtoHSV(r, g, b, hsv[0], hsv[1], hsv[2]);
float saturated = hsv[1] > SATURATION_THRESHOLD ?
hsv[1] * ((float)liveHSVSaturation / 10) : hsv[1];
float saturation = saturated < MAX_HSV_SATURATION ? saturated : MAX_HSV_SATURATION;

View File

@ -294,6 +294,7 @@ function showToast(text, error = false)
clearTimeout(timeout);
x.style.animation = 'none';
timeout = setTimeout(function(){ x.className = x.className.replace("show", ""); }, 2900);
if (error) console.log(text);
}
function showErrorToast()

File diff suppressed because it is too large Load Diff