[IPython-dev] default colorscheme

Fernando Perez fperez.net at gmail.com
Wed Jul 6 03:10:04 EDT 2011


On Tue, Jul 5, 2011 at 10:50 PM, MinRK <benjaminrk at gmail.com> wrote:
> what's the best way to
> evaluate whether an rgb value is 'light' or 'dark'?

Quick and dirty:

light = (r+g+b)/3.0 > 0.5

assuming (r,g,b) normalized to 0-1, adjust accordingly if they're in 0-255.

Cheers,

f



More information about the IPython-dev mailing list