Skip to content

Conversation

@Adenilson
Copy link
Contributor

Adding a description to address the case of a Grooved black border making explicit what is the expected behavior of a UA.

For whole discussion, please see:
https://lists.w3.org/Archives/Public/www-style/2015Sep/0106.html

…aking

it explicit what is the expected behavior of a UA.

For whole discussion, please see:
https://lists.w3.org/Archives/Public/www-style/2015Sep/0106.html
@tabatkins
Copy link
Member

As stated in IRC by @SimonSapin, explicitly calling out "black" isn't correct here. Near-black colors like #000001 have the same problems, and so do colors near white.

What we want to do is check if the difference between the "lighter" and "darker" color is sufficiently large; when the start color is near the min/max of lightness, it's not, so we'll have to shift the colors a bit.

@tabatkins
Copy link
Member

Let's pretend for a moment that the general algorithm is "represented as HSL, the two colors are the base color, but with lightness +- 10%". (That is, 10 added/subtracted from the lightness, not multiplied by 1.1/.9.)

Then the spec text we want is something like:

Let base color be the used value of 'border-color' as an HSL color. If base color's lightness is between 10% and 90%, then light color and dark color are colors with the same hue and saturation as base color, but lightness 10% higher or lower, respectively, than base color.

Otherwise, if base color's lightness is less than 10%, dark color is black, and light color is a color with the same hue and saturation as base color, but lightness set to 20%.

Otherwise, if base color's lightness is greater than 90%, light color is white, and dark color is a color with the same hue and saturation as base color, but lightness set to 80%.

Tweak the numbers as appropriate for whatever the real light/dark adjuster is.

@SimonSapin
Copy link
Contributor

👍

@Adenilson
Copy link
Contributor Author

Sounds good!

On Mon, Sep 21, 2015 at 1:56 PM, Simon Sapin notifications@github.com
wrote:

[image: 👍]


Reply to this email directly or view it on GitHub
#52 (comment).

@fantasai
Copy link
Collaborator

Closing this request without merging, since a) it's not editing the correct file and b) the statement being added is unambiguously implied by the previous statement anyway. If we want to add an algorithm, that gets filed against Level 4...

@fantasai fantasai closed this May 11, 2016
birtles added a commit to birtles/csswg-drafts that referenced this pull request Dec 4, 2017
This should mostly fix issue w3c#52
frivoal pushed a commit to frivoal/csswg-drafts that referenced this pull request Nov 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants