this post was submitted on 24 Jun 2023
11 points (100.0% liked)

Programming

13371 readers
1 users here now

All things programming and coding related. Subcommunity of Technology.


This community's icon was made by Aaron Schneider, under the CC-BY-NC-SA 4.0 license.

founded 1 year ago
MODERATORS
 

Hello! I'm trying to understand how a color has been obtained by merging two other colors, for instance:

--color1: #02c390;
--color2: #31363B;

--result: #24544C;

I would like to create --result by merging the two other colors, but I don't know the percentage. I tried using color-mix but I didn't get any close results. how can I get the percentage of the two colors needed to obtain the result?

thanks in advance!

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 6 points 1 year ago (2 children)

The only way to do this is by dividing this into R, G, B and then do the math on these. See Here

[–] [email protected] 3 points 1 year ago

Doesn't look like a linear operation in RGB color space to me just eyeing the hex values. Might be an operation in HSL or CMYK spaces

[–] [email protected] 2 points 1 year ago

Thanks for the link!