Skip to content

Commit 4153651

Browse files
committed
Clarified when results from hslToRgb will be in [0,1] w3c#9222
1 parent d43de75 commit 4153651

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

css-color-4/Overview.bs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2306,7 +2306,7 @@ Converting HSL Colors to sRGB</h3>
23062306
Here's a sample implementation of the conversion algorithm in JavaScript.
23072307
It returns an array of three numbers
23082308
representing the red, green, and blue channels of the colors,
2309-
normalized to the range [0, 1].
2309+
which for colors in the sRGB gamut will be in the range [0, 1].
23102310

23112311
This code assumes that <em>parse-time</em> clamping
23122312
of negative saturation has already been applied.

css-color-4/hslToRgb.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @param {number} hue - Hue as degrees 0..360
33
* @param {number} sat - Saturation in reference range [0,100]
44
* @param {number} light - Lightness in reference range [0,100]
5-
* @return {number[]} Array of RGB components 0..1
5+
* @return {number[]} Array of sRGB components; in-gamut colors in range [0..1]
66
*/
77
function hslToRgb(hue, sat, light) {
88
hue = hue % 360;

0 commit comments

Comments
 (0)