1 帖子
Color Converter: compare the same color across HEX, RGB, and HSL
HEX, RGB, and HSL can describe the same sRGB color in different notation. Enter a known color, convert between all three, then return to the original format. Allow for rounding in HSL values, but compare the rendered RGB result and alpha separately.
Test a neutral gray and a saturated color; gray has an arbitrary-looking hue in some displays because its saturation is zero. Invalid channel ranges should produce a clear error or a documented clamp. Report input, selected format, expected channels, and actual output. MDN provides format examples.
·1