Had a quick read of Practical Color Theory for People Who Code.
Tag Archives: colour
Firebug DOM panel colour-coding/legend
Found out (over here) that the colour codes in Firebug are:
Format Description Bold Black Objects Black DOM objects get in gray "Getter" functions Bold green User functions Green DOM functions Bold Red Constructor functions
Set toolbar colour with HTML meta element theme-color
See here for example:
<meta name="theme-color" content="#123456">
Color Scale Generator
Removing colour code special characters with sed
I want to post-process the output of an ‘ls’ command with ‘sed’ so that I can remove the ‘./’ prefixes that I can’t avoid going into the ls output (this is a result of using ‘find’ safely).
The thing is, if I pipe ls output to sed, then the default –color=auto setting applies and ls detects that it’s not talking to a terminal so doesn’t output colour codes. But I want colour codes, usually, so I need to change the ls command to use –colour=always, which I’ve done. This means I can have colour and also have sed format the ls output.
The problem is then what happens if I want to pipe my output to ‘less’? Then the colour code commands appear as garbage in the output stream. So, usually I want colour codes, and sometimes I don’t.
I found this article, Remove color codes (special characters) with sed, which helped me come up with the following bash alias:
alias noco='sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"'
So now that I have the ‘noco’ alias (short for “no colour”) I can pipe my output through that if I want the colour codes removed, which I can apply before piping output to less.
It’s a little bit annoying that I have to do things this way but I haven’t been able to think of a better way to make it all work and this all seems to get the job done.
HTML/CSS hexadecimal colour codes
Found a few handy web pages that help pick HTML/CSS colours. Hex Hub and Hexadecimal Color Codes.