groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Groff] Groff Pic and colored objects!


From: Deri James
Subject: Re: [Groff] Groff Pic and colored objects!
Date: Fri, 23 May 2008 23:03:10 +0100
User-agent: KMail/1.9.9

On Friday 23 May 2008 19:23:12 pod wrote:
> How can I define own colors?

Hi Pod,

Dean has illustrated the use of "shaded" in pic. You can get a list of 
predefined colour names by looking for the file "ps.tmac". You can also 
define your own colours (from 'info'):-

===========================================

 -- Request: .defcolor ident scheme color_components
     Define color with name IDENT.  SCHEME can be one of  the following
     values: `rgb' (three components), `cmy' (three components), `cmyk'
     (four components), and `gray' or `grey' (one component).

     Color components can be given either as a hexadecimal string or as
     positive decimal integers in the range 0-65535.  A hexadecimal
     string contains all color components concatenated.  It must start
     with either `#' or `##'; the former specifies hex values in the
     range 0-255 (which are internally multiplied by 257), the latter
     in the range 0-65535.  Examples: `#FFC0CB' (pink), `##ffff0000ffff'
     (magenta).  The default color name value is device-specific
     (usually black).  It is possible that the default color for `\m'
     and `\M' is not identical.

     A new scaling indicator `f' has been introduced which multiplies
     its value by 65536; this makes it convenient to specify color
     components as fractions in the range 0 to 1 (1f equals 65536u).
     Example:


          .defcolor darkgreen rgb 0.1f 0.5f 0.2f

     Note that `f' is the default scaling indicator for the `defcolor'
     request, thus the above statement is equivalent to


          .defcolor darkgreen rgb 0.1 0.5 0.2

==========================================

You must place your ".defcolor" BEFORE your .PS line. So, this should work:-

.defcolor GroovyGreen rgb #60b040
.defcolor PerfectPink rgb #f0b0b0
.PS
box height 0.3 shaded "GroovyGreen" "foofoo";
arrow arrowwid 1;
box width 3 height 3 shaded "PerfectPink";
{"foofoo" at last box .n + (0,-0.1);}
box width 1.8 height 1.5 at last box .w + (1.5,0);
.ps 8
{"\fBfoofoo()\fR" colour "GroovyGreen" at last box .n + (0,-0.3);}
.PE

Cheers

Deri




reply via email to

[Prev in Thread] Current Thread [Next in Thread]