Given a set of 3 colors, keeping the same ratios, but starting with a new color, generate the next two.
For example, the following is a pleasing blue gradient:
rgb(172, 228, 248) – Start
rgb(108, 205, 243) – Finish
rgb(121, 181, 203) – Border
I need to create a series of 10 similar gradients starting from different colors. I’d like the gradients to maintain the same light-to-dark ratios.
So, given the color: rgb(254, 218, 113) (yellow), how can I calculate the end and border colors with the same ratios as above?
Here’s my try: suppose your initial three colors are:
And suppose the color which you’d like to calculate the analogous pattern on is
rgb(x1, y1, z1). The other two components are calculated like this:And thus your resulting colors are
rgb(x2, y2, z2)andrgb(x3, y3, z3).Here’s the result of applying the method above on your example color (
rgb(254, 218, 113)):The two resulting colors are
rgb(159, 196, 110)andrgb(178, 173, 92)(note that they’re rounded down to integers/whole numbers).I hope that helped in any manner!