ygev / cluse

Sketch Plugin to check and adjust color contrast accessibility with live preview and sliders. Endorsed by Sketch.
https://cluse.cc/
GNU General Public License v3.0
59 stars 0 forks source link

Compare two layers with opacity #4

Closed flytoe closed 4 years ago

flytoe commented 4 years ago

I often use opacity values to match colors on buttons. For example a yellow button with a black (0.8) label. This doesn’t work for now because cluse just interprets the color value with full opacity.

stdk00 commented 4 years ago

completely agree. a lot of my text styles have transparency, so this is a must-have.

fafrd commented 4 years ago

Partially resolved. Here's what my commit said:


The color contrast calculation now functions correctly when the
foreground is partially transparent.

Also resolves an issue where the fg or bg opacity value was being
overwritten with 100%.

This isn't an ideal fix for a couple reasons-
- the background opacity is not taken into account.
    This is because we haven't figured out a clever way to get the color
    of whatever is behind the background. It's not immediately clear
    what to do given what the sketch api provides.
- the opacity can't be changed from the plugin menu. it's displayed but
  totally static