Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

save restore rgbcolor

2 views
Skip to first unread message

scroeschwoog

unread,
Dec 8, 2010, 11:46:05 PM12/8/10
to
Hi all
I have a postscript procedure that modify the text color, (setrgbcolor).
for example:
0 0 0 setrgbcolor
save
bla bla....
0 1 1 setrgbcolor
bla bla...
restore

I want to restore the value from "rgbcolor" that was modified by the
procedure


luserXtrog

unread,
Dec 9, 2010, 12:47:41 AM12/9/10
to
On Dec 8, 10:46 pm, scroeschwoog <scroeschw...@free.fr> wrote:
> Hi all
> I have a postscript procedure that modify the text color, (setrgbcolor).
> for example:

Usually, postscript procedures are enclosed in {curly brackets}.

> 0 0 0 setrgbcolor
> save
> bla bla....

These types of discussion often work better with 'real' code.
Hypothetical questions get hypothetical answers.

> 0 1 1 setrgbcolor
> bla bla...
> restore
>
> I want to restore the value from "rgbcolor" that was modified by the
> procedure

currentrgbcolor will deposit three values on the stack which
you may 'restore' later using setrgbcolor.

If I interpret your intent correctly (of which I'm not sure),
you can stash data on the stack to retain across the restore.

0 0 0 setrgbcolor
save
bla bla....
0 1 1 setrgbcolor
bla bla...

currentrgbcolor
restore
setrgbcolor

I often use currentpoint and moveto this way, sandwiched around a
grestore.

--
luser

0 new messages