Here is some example on how to generate the "R/G/B-ish" lists:
#!/usr/bin/perl -Twl use strict; my @SAFE = qw(0 51 102 153 204 255); my @RGB = ([RED => 0], [GREEN => 1], [BLUE => 2]); sub get_set {grep { $_ >= $_[0] && $_ < $_[1] } @SAFE} sub dec_hex {map {sprintf "%02x", $_} @_} sub permute { my $last = pop @_; return map [$_], @$last if(!@_); return map { my $left = $_; map [@$left, $_], @$last } permute(@_); } foreach my $R (@RGB) { print $/, $R->[0], 'ish:'; foreach my $t (get_set(51, 256)) { my @clrs = get_set(0, $t); foreach (permute(\@clrs, \@clrs)) { my @tuple = @$_; splice(@tuple, $R->[1], 0, $t); print '#', dec_hex(@tuple); } } } print $/, 'GRAYish:'; print '#', dec_hex(($_)x3) for @SAFE;
In reply to "R/G/B-ish" colors lists
by AltBlue
in thread HTML RGB hex color
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |