Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Applying screendesigns with transparent layers correctly #126

Open
soelen-hella opened this issue Jun 11, 2024 · 0 comments
Open

Applying screendesigns with transparent layers correctly #126

soelen-hella opened this issue Jun 11, 2024 · 0 comments

Comments

@soelen-hella
Copy link

soelen-hella commented Jun 11, 2024

Hey, trying to figure out how to get the correct values correctly based on a figma design:

elevation levels

The background color is #f0f3f1, primary40 is #007d40. As we can see from the screenshot we have 5 different layers with different opacity levels, 5, 8, 11, 12 and 14%.

So what I try to do e.g. with the 14% layer is following:

const elevationLevel5 = colord( '#f0f3f1' ).mix( '#007d40', 0.14 ).toHex()

According to a color picker it should result to #cee2d8 but what I get is #d3e2d6, which looks like this:

result highlighted result

So my question is: Am I doing something wrong with my way of calculating it? Is the mix algorithm is a different one than what we see in figma/on a browser?

Thanks in advance

Edit: Looking at HSL values it seems like the color is off by hue, saturation and lightness as well.

Should: hsl(150, 26%, 85%), calculation: hsl(134, 21%, 86%)

@soelen-hella soelen-hella changed the title Applying screendesigns with transparent layers correctly, Applying screendesigns with transparent layers correctly Jun 11, 2024
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

No branches or pull requests

1 participant