summaryrefslogtreecommitdiff
path: root/ipl/gprogs/clrs2pdb.icn
diff options
context:
space:
mode:
Diffstat (limited to 'ipl/gprogs/clrs2pdb.icn')
-rw-r--r--ipl/gprogs/clrs2pdb.icn56
1 files changed, 56 insertions, 0 deletions
diff --git a/ipl/gprogs/clrs2pdb.icn b/ipl/gprogs/clrs2pdb.icn
new file mode 100644
index 0000000..e798f17
--- /dev/null
+++ b/ipl/gprogs/clrs2pdb.icn
@@ -0,0 +1,56 @@
+############################################################################
+#
+# File: clrs2pdb.icn
+#
+# Subject: Program to create custom palettes from color lists
+#
+# Author: Ralph E. Griswold
+#
+# Date: October 29, 2001
+#
+############################################################################
+#
+# This file is in the public domain.
+#
+############################################################################
+#
+# This program builds a palette database from color lists.
+#
+############################################################################
+#
+# Requires: Version 9 graphics
+#
+############################################################################
+#
+# Links: basename, palettes, xcode
+#
+############################################################################
+
+link basename
+link palettes
+link xcode
+
+global PDB_
+
+procedure main(args)
+ local file, input, clist, line, name
+
+ every file := !args do {
+ input := open(file) | {
+ write(&errout, "*** cannot open ", image(file))
+ next
+ }
+ name := basename(file, ".clr")
+ clist := []
+ while line := read(input) do {
+ line ?:= tab(upto('\t'))
+ put(clist, line)
+ }
+ close(input)
+ makepalette(name, clist) |
+ write(&errout, "*** could not make palette from ", image(file))
+ }
+
+ xencode(PDB_, &output)
+
+end