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!

  • Lilie
    link
    fedilink
    51 year ago

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

    • key
      link
      fedilink
      31 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

    • tubbaduOP
      link
      21 year ago

      Thanks for the link!

  • @mifuyne@beehaw.org
    link
    fedilink
    21 year ago

    I don’t know how exact the values need to be, but optically, the closest I could get to --result is with these values, still using color-mix:

    color-mix(in srgb, #02C390, 79% #31363B)
    

    It came out as #27544D

    To be fair, my monitors are not colour calibrated so it might not even look like that on your screen or anyone else’s.

    If you don’t mind me asking, how did you arrive at --result’s value?

    • tubbaduOP
      link
      11 year ago

      deleted by creator

    • tubbaduOP
      link
      11 year ago

      deleted by creator

    • tubbaduOP
      link
      11 year ago

      Thanks for the answer! How did you obtained this value? I’m looking for an automated way to do this

      If you don’t mind me asking, how did you arrive at --result’s value?

      I’m trying to “”“reverse engineere”“” a color theme, and I need to understand the percentage of accent color used to obtain some colors

    • tubbaduOP
      link
      11 year ago

      deleted by creator

    • tubbaduOP
      link
      11 year ago

      deleted by creator