Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions css-color-4/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1293,6 +1293,11 @@ will have a [=powerless=] hue component.
have an <em>extremely small</em> chroma rather than precisely ''0%'';
as a result, the hue component is [=powerless=].

When changing a powerless hue component to a [=missing component=],
the chroma (or other measure of colorfulness, such as saturation in ''hsl'') is set to zero
Comment thread
romainmenke marked this conversation as resolved.
Outdated
to avoid amplifying floating-point noise.
In the case of ''hwb'' set ''b'' to ''100 - w'' or if either ''b'' or ''w'' is missing set the other component to ''100''.

@romainmenke romainmenke Jul 31, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For hwb this must only be done when W + B >= 99.999 and W + B < 100 to avoid clamping.

Maybe clearer in pseudo code than in prose?

1. if `w` + `b` is greater than `99.999` and `w` + `b` is less than `100`
2. if `w` and `b` are not missing
  2.1. set `b` to `100 - w`
3. else if `w` is not missing
  3.1. set `w` to `100`
4. else if `b` is not missing
  4.1. set `b` to `100`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that is much clearer

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The if condition on 1. covers 2. to 4. if true, right?

@romainmenke romainmenke Aug 5, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

Maybe clearer:

1. if `w` + `b` is greater than `99.999` and less than `100` and `w` and `b` are not missing
...

Or:

1. if `w` + `b` is greater than `99.999` and `w` + `b` is less than `100`
  1.1. if `w` and `b` are not missing
    1.1.1. set `b` to `100 - w`
  1.2. else if `w` is not missing
    1.2.1. set `w` to `100`
  1.3. else if `b` is not missing
    1.3.1. set `b` to `100`

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have applied the second option and also replaced 99.999 with ε.

I've also added a clarification that this step should only be applied for other color spaces between zero and ε.


<h3 id=parse-color>
Parsing a <<color>> Value</h3>

Expand Down
Loading