Bug 223458 - Web Inspector: color-contrast() should have color swatch
Summary: Web Inspector: color-contrast() should have color swatch
Status: ASSIGNED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Nikita Vasilyev
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-03-18 11:25 PDT by Nikita Vasilyev
Modified: 2021-03-21 10:45 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nikita Vasilyev 2021-03-18 11:25:41 PDT
I propose to add a read-only color swatch before `color-contrast`

    [ ] color-contrast(var(--brand) 40%, white)
     ^
     resulting color
Comment 1 Radar WebKit Bug Importer 2021-03-18 11:25:50 PDT
<rdar://problem/75582067>
Comment 2 Sam Weinig 2021-03-18 17:46:52 PDT
Would also be really cool to somehow expose the different contrast ratios being compared.
Comment 3 Nikita Vasilyev 2021-03-19 13:58:45 PDT
Yeah, that would be nice.

I've worked on Bug 204772 - Web Inspector: Add text/background contrast ratio information to color picker. Unfortunately, I didn't finish it. If I add custom UI for color-contrast(), I should finish that patch 1st.
Comment 4 Sam Weinig 2021-03-21 10:45:41 PDT
(In reply to Nikita Vasilyev from comment #3)
> Yeah, that would be nice.
> 
> I've worked on Bug 204772 - Web Inspector: Add text/background contrast
> ratio information to color picker. Unfortunately, I didn't finish it. If I
> add custom UI for color-contrast(), I should finish that patch 1st.

It's too bad none of that math / color conversion code is using the version we have in WebCore. Is there a pattern we can establish to expose some of the functionality we have in the engine to the inspector so the math always lines up perfectly?