in reply to HTML RGB hex color

heh. seeing your snippet remembered of some neat stuff i did sometime ago to check up a nice code (Permutations and combinations) written by merlyn
here is a quick list of the so called 'browser safe colors':
#!/usr/bin/perl -w use strict; my @clrs = ('00','33','66','99','CC','FF'); my $sw; print '#',join('',@$_),(++$sw%6?$":$/) for permute(\@clrs,\@clrs,\@clr +s); sub permute { my $last = pop @_; return map [$_], @$last if(!@_); return map { my $left = $_; map [@$left, $_], @$last } permute(@_); }

--
AltBlue.

Replies are listed 'Best First'.
Re: Browser safe colors :)
by slloyd (Hermit) on Apr 23, 2005 at 14:39 UTC
    Nice Code.. but any idea how you would generate these colors so that like colors are together?

      Hm, define “like colors” and “together” ;-)

        "Like colors" would be to put the blues together and the reds together, and so forth. Your current script create four sets of like colors instead of one.. In other words.. is it possible to generate the colors to follow the color spectrum so that all like colors are grouped together (greens with greens, reds with reds, etc.)?