mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-25 09:57:32 +09:00
Issue #2982 - Fix regressions in the previous regression fix commit.
This commit is contained in:
parent
2540231fbd
commit
22272f97be
2 changed files with 6 additions and 11 deletions
|
|
@ -189,18 +189,13 @@ OKLabToSRGBColor(float aL, float aA, float aB, float aAlpha)
|
||||||
uint8_t alpha =
|
uint8_t alpha =
|
||||||
nsStyleUtil::FloatToColorComponent(mozilla::clamped(aAlpha, 0.0f, 1.0f));
|
nsStyleUtil::FloatToColorComponent(mozilla::clamped(aAlpha, 0.0f, 1.0f));
|
||||||
|
|
||||||
// Treat values extremely close to the endpoints as the endpoints to avoid
|
// Treat values extremely close to zero as zero to avoid tiny floating-point
|
||||||
// tiny floating-point representation differences for percentage inputs.
|
// representation differences for percentage inputs.
|
||||||
static constexpr float kLightnessEndpointEpsilon = 0.000002f;
|
static constexpr float kLightnessEndpointEpsilon = 0.000002f;
|
||||||
|
|
||||||
// If lightness is at either endpoint, the color is black/white regardless
|
|
||||||
// of chroma and hue (or a/b).
|
|
||||||
if (lightness <= kLightnessEndpointEpsilon) {
|
if (lightness <= kLightnessEndpointEpsilon) {
|
||||||
return NS_RGBA(0, 0, 0, alpha);
|
return NS_RGBA(0, 0, 0, alpha);
|
||||||
}
|
}
|
||||||
if (lightness >= 1.0f - kLightnessEndpointEpsilon) {
|
|
||||||
return NS_RGBA(255, 255, 255, alpha);
|
|
||||||
}
|
|
||||||
|
|
||||||
float lRoot = lightness + 0.3963377774f * aA + 0.2158037573f * aB;
|
float lRoot = lightness + 0.3963377774f * aA + 0.2158037573f * aB;
|
||||||
float mRoot = lightness - 0.1055613458f * aA - 0.0638541728f * aB;
|
float mRoot = lightness - 0.1055613458f * aA - 0.0638541728f * aB;
|
||||||
|
|
|
||||||
|
|
@ -401,14 +401,14 @@ var noframe_container = document.getElementById("content");
|
||||||
["hsl(0 0% 0% / 0.5)", "rgba(0, 0, 0, 0.5)"],
|
["hsl(0 0% 0% / 0.5)", "rgba(0, 0, 0, 0.5)"],
|
||||||
["oklab(0 0 0 / 1)", "rgb(0, 0, 0)"],
|
["oklab(0 0 0 / 1)", "rgb(0, 0, 0)"],
|
||||||
["oklab(0 0 0 / 0.5)", "rgba(0, 0, 0, 0.5)"],
|
["oklab(0 0 0 / 0.5)", "rgba(0, 0, 0, 0.5)"],
|
||||||
["oklab(150% 0.5 0.2 / 1)", "rgb(255, 255, 255)"],
|
["oklab(150% 0.5 0.2 / 1)", "rgb(255, 0, 0)"],
|
||||||
["oklch(0 0 0 / 1)", "rgb(0, 0, 0)"],
|
["oklch(0 0 0 / 1)", "rgb(0, 0, 0)"],
|
||||||
["oklch(0 0 0 / 0.5)", "rgba(0, 0, 0, 0.5)"],
|
["oklch(0 0 0 / 0.5)", "rgba(0, 0, 0, 0.5)"],
|
||||||
["oklch(0.0001% 0.2 45 / 1)", "rgb(0, 0, 0)"],
|
["oklch(0.0001% 0.2 45 / 1)", "rgb(0, 0, 0)"],
|
||||||
["oklch(99.9999% 0.2 45 / 1)", "rgb(255, 255, 255)"],
|
["oklch(99.9999% 0.2 45 / 1)", "rgb(255, 207, 132)"],
|
||||||
["oklch(0% 1.1 60 / 1)", "rgb(0, 0, 0)"],
|
["oklch(0% 1.1 60 / 1)", "rgb(0, 0, 0)"],
|
||||||
["oklch(100% 110 60 / 1)", "rgb(255, 255, 255)"],
|
["oklch(100% 110 60 / 1)", "rgb(0, 255, 0)"],
|
||||||
["oklch(150% 0.5 50 / 1)", "rgb(255, 255, 255)"],
|
["oklch(150% 0.5 50 / 1)", "rgb(255, 0, 0)"],
|
||||||
];
|
];
|
||||||
|
|
||||||
var p = document.createElement("p");
|
var p = document.createElement("p");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue