Curly Counting - Oneliner Shell Script To Generate 216 Websafe Colors
2/04/2014 12:35:00 PM
Jsc Jwhat Jerome Christopher
, Posted in
Browsers
,
Linux
,
Shell Scripts
,
Tiny tools
,
Tips'nTricks
,
Web Tools
,
websafe colors
I once came across an interesting oneliner on stackoverflow. This little seemingly repetitive sequence of three sets of decimal numbers really was counting. Counting big time! From zero through one thousand! Impressive. Check the original oneliner below.
CURLIES FOR COLOR CODE GENERATION?
A while after reading this, I needed a way to generate websafe colors for my color-matching/color-testing tool and this little guy suddenly jumped at me from nowhere. Can I use this counter for my color tool? If I can get it to create the list of color codes for me, that would be so great since I can improve upon it! I started simply at first and got the list of color codes. Then I added a div to hold the styling elements. Finally I added width, height and background color to the style string and stored the output in a html file with the 216 websafe colors and immediately opened it with the browser all at once. All within the oneliner itself, of course! It was so simple, so easy and so cool. You must try this oneliner and two other variations of it yourself to view the websafe color pages it creates. Don't forget to change the browser if needed!