Re: [csswg-drafts] [css-scrollbars][css-scrollbars-1] Using scrollbar-color to tint the scrollbar (#5651)

One starting point to approach this, just to get the ball rolling, could be to use the provided color for the thumb and calculate the track color by keeping the same hue and changing lightness/saturation automatically until the desired contrast is found.

In the first example above, the thumb would be `#FFA500` and the track would perhaps be `#362B17` (using this [contrast checker](https://colourcontrast.cc/362b17/ffa500) as reference).

In the second, the thumb would be `#006400` and the track would perhaps be `#E5ffE5` ([reference](https://colourcontrast.cc/e5ffe5/006400)).

This approach might not work in all cases, for instance with the `crimson` color `#DC143C`. For those cases, maybe the thumb color would need to be changed slightly to increase the contrast with the background. For example, `scrollbar-color: crimson;` might produce a `#9e0e2b`thumb and a `#fae9ed`track ([reference](https://colourcontrast.cc/fae9ed/9e0e2b)).

-- 
GitHub Notification of comment by felipeerias
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5651#issuecomment-714922698 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 23 October 2020 05:32:18 UTC