rgb2cm - Fix RGB color data in Painter's mode

Workaround for patches only for the warning: RGB color data not yet supported in Painter's mode
910 Downloads
Updated 6 Mar 2012

View License

Painter's mode rendering is required for copying a figure to the clipboard as an EMF (vector format) or printing to vector-format files such as PDF and EPS. However, if the colours of any patches in your figure are represented using CData and an RGB colour code, these will not show in the copied figure. You may also get a warning like:

Warning: RGB color data not yet supported in Painter's mode

The solution is to change these specific patches to use an index into the colormap. That's what this script does. For each patch using RGB, it adds those colours to the colormap and changes the patch to use a colormap index.

Cite As

Robbie Andrew (2024). rgb2cm - Fix RGB color data in Painter's mode (https://www.mathworks.com/matlabcentral/fileexchange/35469-rgb2cm-fix-rgb-color-data-in-painter-s-mode), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2011b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Lighting, Transparency, and Shading in Help Center and MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.1.0.0

Corrected for patches having faces of different colours.

1.0.0.0