Introduction to PDF color Part I: RGB color

Introduction to PDF color Part I: RGB color

One of the first sample apps I re-purposed for my Introduction to PDF color presentation was a bit of code to create a color wheel.

The basic insight to this code is that if you have three color components,  you have essentially eight full-on states, two of which are white, and black, three of which are the color components by themselves, and three of which are combinations of two color components. For a color wheel, you want to transition between these combinations changing only one component at a time; Gray code, essentially.

That said, my initial color wheel wasn’t ideal for talking about it as it followed the trigonometric angle conventions which meant that if the color wheel was a clock, red was at 3o’clock, Green at 11o’clock, and Blue at 7o’clock. So I eventually reversed directions and put my first component at the top of the hour, and added tick marks for the primary colors, the secondary colors, and the tertiary colors in between the primary and secondary colors.

Initial color wheel (L), rotated color wheel (R)
Initial color wheel (L), rotated color wheel (R)

For the transitions to the final two states, I was faced with a stark black and white choice: I had chose one of these two colors for the center.  Each wedge of my wheel  used an Axial shading pattern to interpolate from the center color to the color on the outer edge.  …Or  instead of choosing, I could do two wheels (see Page 2).

Color Wheel with White Center (L), Color Wheel with Black Center (R)
Color Wheel with White Center (L), Color Wheel with Black Center (R)

Between the interpolations around the circle and the interpolation to/from the center done by the Axial Shading Pattern, the color wheel should be a fairly complete representation of the possible colors.  That said, if you try to have too many axial shading patterns in your contents, Acrobat ends up displaying Pac-man rather than a wheel; 6 colors per combination, or 10 degrees per color, is about the limit for a complete Axial (Shading Pattern) wheel.  (see Page 3 of the output PDF).

Color wheels with increasing finer interpolation From Left to Right.
Color wheels with increasing finer interpolation From Left to Right.

 

So for the last pageof output, I compare and contrast DeviceRGB with a DeviceCMYK color wheel constructed the same way. Compare and contrast each wheels primary and and secondary wheels.

DeviceRGB color wheel (L) vs. DeviceCMYK color wheel (R)
DeviceRGB color wheel (L) vs. DeviceCMYK color wheel (R)

For the next topic, as contradictory as it sounds, I’ll discuss color spaces and shades of gray.

Leave a Reply

Your email address will not be published. Required fields are marked *