kolibrios-fun/programs/other/rainbow/colors.gawk
Ivan Baravy 11a65eeec4 Rainbow: my old app to view CSS colors and their names.
git-svn-id: svn://kolibrios.org@7123 a494cfbc-eb01-0410-851d-a64ba20cac60
2017-11-29 22:52:33 +00:00

34 lines
671 B
Awk

BEGIN {
}
{
cnt++
names[cnt] = $1
colors[cnt] = $2
}
END {
printf "; Autogenerated from colors.txt, do not edit this file!\n"
printf "; gawk -f colors.gawk colors.txt > colors.asm\n\n"
printf "colors dd "
printf colors[1]
for (i=2; i<=cnt; i++) {
printf ", %s", colors[i]
}
printf "\n\n"
printf "names dw "
printf names[1]
for (i=2; i<=cnt; i++) {
printf ", %s", names[i]
}
printf "\n\n"
for (i=1; i<=cnt; i++) {
printf "%s db %d,'%s'\n", names[i], length(names[i]), names[i]
}
}