1

I have multiple original color values.

I'm using a piece of software that only allows me to add hexadecimal hue values (such as hue:0x00ff00 or hue:0x000100) to these values in order to change their color.

EDIT: I cannot directly type the final color I want. I can only control the hue (hexadecimal value), the saturation (value between -100 and 100), the lightness (value between -100 and 100) and the gamma (value between 0.01 and 10.0).

How do I calculate the hue value I need for each original color in order to get the exact same final color after each transformation?

Thanks!

Let me reformulate if I'm unclear:

I have 4 colors to start with #FFA500 (orange), #008000 (green), #800080 (purple) and #FFC0CB (pink). How do I calculate what transformations they need to become deepskyblue (#00BFFF)?

Emilio
  • 1,314
  • 2
  • 15
  • 39
  • You are on the right track. Don't think of color in hex. Each value is 0..1. To go to hex, just multiply by 255. RGB and HSV are both color spaces. Let's assume we can freely move between them with a hsv(rgb) and rgb(hsv) function. So your problem is hsv(original) + (0,x,0) = hsv(final). And solve for x! This would be somewhat easy if rgb->hsv was linear but it is not. Also think about what happens if original is black and final is white? – starmole Aug 27 '17 at 03:16
  • @starmole So, if I understand you correctly, I simply have to convert the values to HSV, then substract the "H", "S" and "V" values separately, then convert back the result to hex? – Emilio Aug 27 '17 at 03:23
  • Is it simply a substraction though? Or a division? – Emilio Aug 27 '17 at 03:25
  • I thought you could only change hue? And no, it is not simple because it is not linear. Again, think of what happens when going from all black to full white. It might help if you add more concrete examples - it still sounds a bit like solving a practical problem "good enough". – starmole Aug 27 '17 at 03:31
  • @starmole I honestly thought so! The piece of software also allows me the change the lightness (value between -100 and 100), the saturation (value between -100 and 100) and the gamma (value between 0.01 and 10.0). Maybe we can do something with these values also? – Emilio Aug 27 '17 at 03:41

0 Answers0