Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
To change the fill or stroke color in a PDF graphics stream, we need to change the current color space using one operator, and then change the color using another. Fill and stroke color spaces are separate—the current fill color space could be DeviceRGB and the stroke color space DeviceGray, for example.
In this section, we look at the basic DeviceGray, DeviceRGB, and DeviceCMYK color spaces (more complicated color spaces are covered in the PDF Standard):
The DeviceGray color space has one additive component, which varies from 0.0 (Black) to 1.0 (White).
The DeviceRGB color space has three additive components for Red, Green, and Blue. They each range from 0.0 (e.g., no Red) to 1.0 (e.g., full Red).