From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: <252037CF-B6B1-4241-AC17-AC7CBBA7CB86@corpus-callosum.com> References: <252037CF-B6B1-4241-AC17-AC7CBBA7CB86@corpus-callosum.com> Date: Mon, 16 May 2011 09:36:04 -0400 Message-ID: Subject: Re: [9fans] where to get color troff? From: Russ Cox To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=UTF-8 Topicbox-Message-UUID: e44d6db8-ead6-11e9-9d60-3106f5b1d025 > They work great for troff, now I just need to investigate applying the same technique to grap. You can do it in pic (and I think grap) by just emitting some text before drawing something. In fact you can do arbitrary postscript code. This snippet uses the Pr string to push the current color on the stack and then switch to gray. The Pb string restores the previous color from the stack. .de XX \\X'\\$1' .br .sp -1 .. .ie \n(yr>=100 .ds Ps "ps: exec .el .ds Ps PS .ds Pr "\*(Ps currentrgbcolor 0.75 0.75 0.75 setrgbcolor .ds Pb "\*(Ps setrgbcolor .G1 frame ht 1.5 wid 4 top invis right invis label bot "Time" label left "Goodput" ticks left out at 0 "0", 1000000 "1Mbps" .XX "\*(Pr copy "/tmp/6.829/FQCBR:net0-stput-0.dat!" thru / next at $1,$2 / new solid .XX "\*(Pb copy "/tmp/6.829/FQCBR:net0-stput-1.dat!" thru / next at $1,$2 / new solid copy "/tmp/6.829/FQCBR:net0-stput-2.dat!" thru / next at $1,$2 / .G2