Thursday, November 19, 2015

Derive color palette from given set of colors


I have a set of colors on a webpage where one color is the main one:


#864062 <-- main color
#853f61
#925071
#541c38

#64304A
#eac9d7

Now I would like to derive similar color scheme for any arbitrary main color.


My idea was to:



  1. Convert all colors to decimal notation (r, g, b)

  2. Calculate ratio of individual components for each other color and main color

  3. Use these rates as a conversion matrix for any other main color.



For my example, rgb of individual colors is:


134  64  98
133 63 97
146 80 113
84 28 56
100 48 74
234 201 215

Ratio of each component (other color / main color):


0.99 0.98 0.99

1.09 1.25 1.15
0.63 0.44 0.57
0.75 0.75 0.76
1.75 3.14 2.19

Now for any new main color I can calculate all the other colors:


100 100 100 <-- new main color
99 98 99
109 125 115
63 44 57

75 75 76
175 255 219 (max is 255, cannot have 314)

My question is if this way of calculation makes any sense as I have never done any math with colors before.




No comments:

Post a Comment

technique - How credible is wikipedia?

I understand that this question relates more to wikipedia than it does writing but... If I was going to use wikipedia for a source for a res...