summaryrefslogtreecommitdiff
path: root/ipl/gprocs/colrspec.icn
diff options
context:
space:
mode:
Diffstat (limited to 'ipl/gprocs/colrspec.icn')
-rw-r--r--ipl/gprocs/colrspec.icn48
1 files changed, 48 insertions, 0 deletions
diff --git a/ipl/gprocs/colrspec.icn b/ipl/gprocs/colrspec.icn
new file mode 100644
index 0000000..03b4322
--- /dev/null
+++ b/ipl/gprocs/colrspec.icn
@@ -0,0 +1,48 @@
+############################################################################
+#
+# File: colrspec.icn
+#
+# Subject: Procedure to produce VRML color specifications
+#
+# Author: Ralph E. Griswold
+#
+# Date: May 3, 1997
+#
+############################################################################
+#
+# This file is in the public domain.
+#
+############################################################################
+#
+# Requires: Version 9 graphics
+#
+############################################################################
+#
+# Links: wopen
+#
+############################################################################
+
+link wopen
+
+procedure colrspec(s)
+ local color
+ static max, win
+
+ initial {
+ max := real(2 ^ 16 - 1)
+ WOpen("canvas=hidden")
+ }
+
+ color := ""
+
+ ColorValue(s) ? {
+ every 1 to 3 do {
+ color ||:= (tab(upto(",") | 0) / max) || " "
+ move(1)
+ }
+ return color
+ }
+
+ fail
+
+end