aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/postscript/mcolor
diff options
context:
space:
mode:
authorwkj <devnull@localhost>2004-05-16 07:54:22 +0000
committerwkj <devnull@localhost>2004-05-16 07:54:22 +0000
commitb855148c9b6d28fedfd083d037bcf246f1913d92 (patch)
tree0075eb6ea37427fa48b78cb937fabc04175cead1 /src/cmd/postscript/mcolor
parent61f5c35c9465f0702739b41249a664d409f0482c (diff)
downloadplan9port-b855148c9b6d28fedfd083d037bcf246f1913d92.tar.gz
plan9port-b855148c9b6d28fedfd083d037bcf246f1913d92.tar.bz2
plan9port-b855148c9b6d28fedfd083d037bcf246f1913d92.zip
Checkpoint.
Diffstat (limited to 'src/cmd/postscript/mcolor')
-rw-r--r--src/cmd/postscript/mcolor/.cvsignore1
-rw-r--r--src/cmd/postscript/mcolor/color.sr45
-rw-r--r--src/cmd/postscript/mcolor/mcolor.560
-rw-r--r--src/cmd/postscript/mcolor/mcolor.mk53
4 files changed, 159 insertions, 0 deletions
diff --git a/src/cmd/postscript/mcolor/.cvsignore b/src/cmd/postscript/mcolor/.cvsignore
new file mode 100644
index 00000000..0c5af57d
--- /dev/null
+++ b/src/cmd/postscript/mcolor/.cvsignore
@@ -0,0 +1 @@
+tmac.color
diff --git a/src/cmd/postscript/mcolor/color.sr b/src/cmd/postscript/mcolor/color.sr
new file mode 100644
index 00000000..0a63aad5
--- /dev/null
+++ b/src/cmd/postscript/mcolor/color.sr
@@ -0,0 +1,45 @@
+.ds Dc black
+.ds Cc \*(Dc
+.de CL \" Color selection macro
+. \"
+. \" $1=color (e.g. .CL red) or
+. \" $1=textcolor on backgroundcolor (e.g. .CL "red on blue")
+. \" $1=red green blue rgb (e.g. .CL ".2 .3 .4 rgb") or
+. \" $1=hue saturation brightness hsb (e.g. .CL ".5 .6 .7 hsb")
+. \" $2=text
+. \"
+. \" If no arguments are given the default color (usually black) will be
+. \" restored. If $2 is omitted the color selected by $1 remains in effect
+. \" until another color is selected. If two arguments are given $2 will be
+. \" printed in color $1 and then the default color will be restored.
+. \"
+. \" The color of the text and the background can be selected by setting $1
+. \" to "textcolor on backgroundcolor" where textcolor and backgroundcolor
+. \" can be any of the known colors. For example use .CL "white on black"
+. \" for reverse video printing. Changing color in a word can be accomplished
+. \" by preceeding the characters with a \X'SetColor:val' command, where val
+. \" is the color you wish to use. Named colors are case independent.
+. \"
+. \" Implementation details are device dependent and are handled in the
+. \" appropriate post-processor. Requesting a color that's not available
+. \" (eg. not defined in /usr/lib/postscript/color.ps) results in the use
+. \" of default colors - black or white on black for reverse video mode.
+. \"
+. \" All colors may not be supported on every output device, and the direct
+. \" specification of a color via an explicit rgb or hsb argument may also
+. \" be device dependent. In any case, to be safe on PostScript devices, all
+. \" numeric paramenters in the direct rgb or hsb specifications should lie
+. \" between 0 and 1 (inclusive). The names of the currently available colors
+. \" on PostScript printers are listed in file /usr/lib/postscript/color.ps.
+. \"
+.mk Ov
+.if \\n(.$=0 .ds Cc \\*(Dc
+.if \\n(.$=1 .ds Cc \\$1
+.if \\n(.$<2 \\X'SetColor:\\*(Cc'
+.if \\n(.$=2 \\X'SetColor:\\$1'\\c
+.if \\n(.$=2 'sp |\\n(Ovu
+.if \\n(.$=2 \\$2
+.if \\n(.$=2 .mk Ov
+.if \\n(.$=2 \\X'SetColor:\\*(Cc'\\c
+'sp |\\n(Ovu
+..
diff --git a/src/cmd/postscript/mcolor/mcolor.5 b/src/cmd/postscript/mcolor/mcolor.5
new file mode 100644
index 00000000..bf0181fd
--- /dev/null
+++ b/src/cmd/postscript/mcolor/mcolor.5
@@ -0,0 +1,60 @@
+.ds dP /usr/lib/postscript
+.ds dT /usr/lib/tmac
+.TH MCOLOR 5
+.SH NAME
+.B mcolor
+\- color and reverse video macro
+.SH SYNOPSIS
+\*(mBtroff \-mcolor\f1
+.OP "" options []
+.OP "" files []
+.SH DESCRIPTION
+.B mcolor
+is a macro package for color selection and reverse video printing
+on PostScript printers.
+The package is compatible with most existing macro packages
+and includes the following macro:
+.TP 1.25i
+.MI .CL "\0color\0text"
+Prints
+.I text
+in
+.IR color .
+No arguments restores the default color (black).
+If
+.I text
+is omitted the selected
+.I color
+remains in effect until another
+.I color
+is selected.
+If two arguments are given the
+.I text
+is printed in
+.I color
+and then the default color is restored.
+.PP
+Both the text and background color can be selected.
+A
+.I color
+argument of
+.RI `` color1
+.MW on
+.IR color2 ''
+prints text in
+.I color1
+on a background in
+.I color2 .
+.PP
+Named colors must be listed in the
+``colordict''
+dictionary in file
+.MR \*(dP/color.ps .
+.SH FILES
+.MW \*(dT/tmac.color
+.br
+.MW \*(dP/color.ps
+.SH SEE ALSO
+.BR troff (1),
+.BR dpost (1),
+.BR mps (5)
diff --git a/src/cmd/postscript/mcolor/mcolor.mk b/src/cmd/postscript/mcolor/mcolor.mk
new file mode 100644
index 00000000..aacadcfb
--- /dev/null
+++ b/src/cmd/postscript/mcolor/mcolor.mk
@@ -0,0 +1,53 @@
+#
+# Not installing the man page.
+#
+
+MAKE=/bin/make
+MAKEFILE=mcolor.mk
+
+SYSTEM=V9
+VERSION=3.3.2
+
+OWNER=bin
+GROUP=bin
+
+POSTLIB=/usr/lib/postscript
+TMACDIR=/usr/lib/tmac
+
+all :
+ @cp color.sr tmac.color
+
+install : all
+ @if [ ! -d $(TMACDIR) ]; then \
+ mkdir $(TMACDIR); \
+ chmod 755 $(TMACDIR); \
+ chgrp $(GROUP) $(TMACDIR); \
+ chown $(OWNER) $(TMACDIR); \
+ fi
+ cp tmac.color $(TMACDIR)/tmac.color
+ @chmod 644 $(TMACDIR)/tmac.color
+ @chgrp $(GROUP) $(TMACDIR)/tmac.color
+ @chown $(OWNER) $(TMACDIR)/tmac.color
+
+clean :
+ rm -f tmac.color
+
+clobber : clean
+
+changes :
+ @trap "" 1 2 3 15; \
+ sed \
+ -e "s'^SYSTEM=.*'SYSTEM=$(SYSTEM)'" \
+ -e "s'^VERSION=.*'VERSION=$(VERSION)'" \
+ -e "s'^GROUP=.*'GROUP=$(GROUP)'" \
+ -e "s'^OWNER=.*'OWNER=$(OWNER)'" \
+ -e "s'^POSTLIB=.*'POSTLIB=$(POSTLIB)'" \
+ -e "s'^TMACDIR=.*'TMACDIR=$(TMACDIR)'" \
+ $(MAKEFILE) >X$(MAKEFILE); \
+ mv X$(MAKEFILE) $(MAKEFILE); \
+ sed \
+ -e "s'^.ds dP.*'.ds dP $(POSTLIB)'" \
+ -e "s'^.ds dT.*'.ds dT $(TMACDIR)'" \
+ mcolor.5 >Xmcolor.5; \
+ mv Xmcolor.5 mcolor.5
+