diff --git a/css-color-4/Overview.bs b/css-color-4/Overview.bs index c43602bfa9c..981b032b706 100644 --- a/css-color-4/Overview.bs +++ b/css-color-4/Overview.bs @@ -6216,37 +6216,46 @@ Serializing sRGB values A seven-character string consisting of the character "#", followed immediately by the two-digit hexadecimal representations of the red component, the green component, and the blue component, in that order, using ASCII lower hex digits. No spaces are permitted.
- For example, the pixel value from a canvas 2D context - using the sRGB colorspace is returned as a Uint8ClampedArray: + For example, fill style is set to magenta:
-			imageData = context.getImageData(0, 0, 1, 1);
-			console.log(imageData.colorSpace);  // "srgb"
-			console.log([...imageData.data]);   // [37, 164, 87, 255]
+			context.fillStyle = "rgb(255, 0, 255)"
+			console.log(context.fillStyle); // "#ff00ff"
 		
- The color space is sRGB, the representation is 8 bits per component, the data format does not produce ''none'' values nor does it support extended range values, and the alpha is 1 (255/255). + The color space is sRGB, the representation is 8 bits per component, + the data format does not produce ''none'' values nor does it support extended range values, + and the alpha is 1. - The HTML-compatible serialization is the string "#25a457" (not "#25A457"). + The HTML-compatible serialization is the string "#ff00ff" (not "#FF00FF").
Otherwise, for sRGB the CSS serialization of sRGB values is used and for other color spaces, the relevant serialization of the <> value.
- For example, the pixel value from a canvas 2D context, - this time using the display-p3 colorspace is returned, - again as a Uint8ClampedArray: + For example, fill style is set to a dark brown, in CIE Lab:
-			imageData = context.getImageData(0, 0, 1, 1);
-			console.log(imageData.colorSpace);  // "display-p3"
-			console.log([...imageData.data]);   // [80, 162, 95, 255]
+			context.fillStyle = "lab(29% 39 20)";
+			console.log(context.fillStyle); // "lab(29 39 20)"
 		
- The CSS serialization is the string "color(display-p3 0.3137 0.6353 0.3725)". + The CSS serialization is the string "lab(29 39 20)".
+ For example, fill style is set to semi-transparent magenta: + +
+			context.fillStyle = "#ff00ffed";
+			console.log(context.fillStyle); // "rgba(255, 0, 255, 0.93)"
+		
+ + The alpha is not 1, so the CSS serialization is the string + "rgba(255, 0, 255, 0.93)". +
+ +

CSS serialization of sRGB values