Skip to main content
Participant
November 26, 2018
Answered

How can I get some RGB colors to appear

  • November 26, 2018
  • 1 reply
  • 303 views

I have not been successful in getting certain colors  using  setrgbcolor to appear.  I am trying to get a cream color to show in both GSview and on my printer, and no color appears.  For example, I can not get 238 213 183 setrgbcolor  to yield any color except the white of the screen or the paper.

Are there certain colors that postscript will not handle?

This topic has been closed for replies.
Correct answer ptlycldy99

I found the answer and am posting it here for other newbies.  The arguments for setrgbcolor  are not in a range of  0 to 255, but rather in a range of 0.0 to 1.0.   You just have to do the math:  take your 255 range number and divide by 255 and use the result as the argument.  Thus the proper result for a cream color would be:  .9255 .8353 .7176 setrgbcolor

I guess the old adage of "read the manual" still applies.

1 reply

ptlycldy99AuthorCorrect answer
Participant
November 26, 2018

I found the answer and am posting it here for other newbies.  The arguments for setrgbcolor  are not in a range of  0 to 255, but rather in a range of 0.0 to 1.0.   You just have to do the math:  take your 255 range number and divide by 255 and use the result as the argument.  Thus the proper result for a cream color would be:  .9255 .8353 .7176 setrgbcolor

I guess the old adage of "read the manual" still applies.