blend function

colourettu.blend(colour_1, colour_2)[source]

Takes two Colour s and returns the ‘average’ Colour.



Uses the formula:

\[r_{blended} = \sqrt \frac{r_1^2 + r_2^2}{2}\]

It is shown here for the red channel, but applied independently to each of the red, green, and blue channels. The reason for doing it this way (rather than using a simple average) is that the brightness of the colours is stored in a logarithmic scale, rather than a linear one.

For a fuller explanation, Minute Physics has released a great YouTube video.

See also