Re: How can i use paragraph color ?

Subject: Re: How can i use paragraph color ?
From: Richard Light <richard@xxxxxxxxxxxxxxxxx>
Date: Wed, 15 Jul 1998 09:40:36 +0100
In message <199807150600.BAA27845@xxxxxxxxxxxxxxxxxxx>, Brandon Ibach
<bibach@xxxxxxxxxxxxxx> writes
>Jun Seong Hak said:
>> 
>> I am a beginner of DSSSL.
>> 
>> I have some questions.
>> 
>> Q1) I would like to use blue color to all p element.
>> 
>> In SGML Document :
>> <p> text..... </p>
>> 
>> In DSSSL file :
>> (element p
>>     (make paragraph
>>      space-before : 6p))
>> 
>   Can't really help here, though I think you'd need to declare the
>color space (RGB) using (color-space ...), then use that in a (color
>...) function as the value of the "color" property in your paragraph
>(which the paragraph itself wouldn't care about, but the characters in
>it would).
>   Can someone who knows what they're talking about help here? :)
>(I'd kinda like to know, too... :)  Unfortunately, the DSSSL standard
>only briefly touches on this stuff, and leaves several important
>details out, instead referring us to another standard (SPDL, I think).

That's right, Brandon.  Here is a snippet from my TEI-Lite style sheet,
with a declaration for *blue* added:

(define *rgb-color-space*
  (color-space "ISO/IEC 10179:1996//Color-Space Family::Device RGB"))

(define *midnight-blue-color*
  (color *rgb-color-space* (/ 25 255) (/ 25 255) (/ 112 255)))
(define *grey*
  (color *rgb-color-space* (/ 2 255) (/ 2 255) (/ 2 255)))
(define *blue*
  (color *rgb-color-space* (/ 0 255) (/ 0 255) (/ 255 255)))

I tried passing simple numerical values (0, 0 and 1) to define 'blue' in
RGB colour space, but Jade wasn't happy with that and insisted on having
some maths to do!  It looks as though with this particular colour space
you need to provide a function for each aspect of the colour that
resolves to a value between 0 and 1.

Having made these colour declarations, you can use them as the value of
the color characteristic:

(element P
 (make paragraph
       color: *blue*
       ... and other characteristics ...        
       (process-children-trim)))

Richard Light.

Richard Light
SGML/XML and Museum Information Consultancy
richard@xxxxxxxxxxxxxxxxx


 DSSSList info and archive:  http://www.mulberrytech.com/dsssl/dssslist


Current Thread
  • How can i use paragraph color ?
    • Jun Seong Hak - from mail1.ability.netby web4-1.ability.net (8.8.5/8.6.12) with ESMTP id AAA05896Wed, 15 Jul 1998 00:49:24 -0400 (EDT)
      • Brandon Ibach - from mail1.ability.netby web4-1.ability.net (8.8.5/8.6.12) with ESMTP id CAA08692Wed, 15 Jul 1998 02:02:39 -0400 (EDT)
        • Richard Light - from mail1.ability.netby web4-1.ability.net (8.8.5/8.6.12) with ESMTP id EAA14914Wed, 15 Jul 1998 04:44:35 -0400 (EDT) <=
      • G. Ken Holman - from mail1.ability.netby web4-1.ability.net (8.8.5/8.6.12) with ESMTP id OAA01876Wed, 15 Jul 1998 14:55:12 -0400 (EDT)