Out of curiousity, I wanted to find out how many words of English are valid HTML colors.

The following one-liner (white-space introduced for clarity):

cat /usr/share/dict/words | 
    perl -E 'while(<>){ 
       chomp; 
       next if length($_) != 6; 
       say if m/^[a-f]+$/i; 
    }'
accede accede accede
bacaba bacaba bacaba
baccae baccae baccae
beaded beaded beaded
bedded bedded bedded
bedead bedead bedead
bedeaf bedeaf bedeaf
decade decade decade
deface deface deface
efface efface efface
facade facade facade

Most of the colors appear pastel because [a-f]+ only allows for (36.0 / 256) ** 3 ~ 0.3% of all the colors. These are also the colors which are closest to white ffffff.

  • bacaba is a South American fruit
  • baccae is plural of bacca, also a kind of fruit
  • bedead and bedeaf don’t seem to have any meaning

Update

If you allow some 1337, then the number balloons to 817.

cat /usr/share/dict/words | 
    perl -E 'while(<>){ 
        chomp; 
        next if length($_) != 6;
        say if m/^[a-folist]+$/i;
    }' | 
    perl -E 'while(<>){ 
        chomp; 
        $a = $_;
        tr/olistOLIST/01157011570/;
        say "$_, $a"; 
    }'