[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Red-to-violet color palette



Hi,

You probably want a linear interpolation between the two colours.  The grey scale is a linear interpolation between white and black.  Imagine a vector of 3 elements represents each colour, then you can use a vector interpolation function at 256 steps between the first colour and the second.

As well as "vector interpolation", see gradients:
    http://www.pygame.org/project-gradients-307-.html
    http://www.pygame.org/wiki/GradientCode


cheers,


On Fri, Jul 13, 2012 at 6:20 PM, Ricardo Franco <ricardo.krieg@xxxxxxxxx> wrote:
I would like to know how to build a specifc color palette, its the red-to-violet color palette.
To build the grayscale color palette I use:

grayscale_palette = tuple([(i, i, i) for i in range(256)])

How do to get the red-to-violet color palette?

--
Ricardo Franco Andrade             @ricardokrieg

( Game | Desktop | Web ) Developer

email: ricardo.krieg@xxxxxxxxx
contact: +55 (86) 9958 9725