commit 7a7bb2a0c7aefcbf1c20a413b96e8b790db2a587 parent 1dfe57f283d32f7fc55e910faacdf64df05f09ef Author: clamiax <smoppy@gmail.com> Date: Tue, 10 Feb 2015 11:09:02 +0100 Add whexsafe Diffstat:
M | README.md | | | 4 | ++++ |
A | whexsafe | | | 25 | +++++++++++++++++++++++++ |
2 files changed, 29 insertions(+), 0 deletions(-)
diff --git a/README.md b/README.md @@ -70,3 +70,7 @@ pkgsetup -------- Managing pkgsrc bootstrapping and installation on non-NetBSD systems. Also supports pkgsrc-wip. + +whexsafe +-------- +Generates the web safe colors list in hex and RGB formats. diff --git a/whexsafe b/whexsafe @@ -0,0 +1,24 @@ +#!/bin/bash +# Generates the web safe colors list in hexadecimal. + +main() { + rgb=(0 3 6 9 C F) + for r in $(seq 0 $(echo ${#rgb[@]} - 1|bc)) + do + for g in $(seq 0 $(echo ${#rgb[@]} - 1|bc)) + do + for b in $(seq 0 $(echo ${#rgb[@]} - 1|bc)) + do + rh=${rgb[$r]} + gh=${rgb[$g]} + bh=${rgb[$b]} + rn=$(echo "${r}*51" | bc) + gn=$(echo "${g}*51" | bc) + bn=$(echo "${b}*51" | bc) + echo "#${rh}${gh}${bh} rgb(${rn}, ${gn}, ${bn})" + done + done + done +} + +main+ \ No newline at end of file