public void setColor(FSColor color) {
if (color instanceof FSRGBColor) {
FSRGBColor rgb = (FSRGBColor) color;
_color = new BaseColor(rgb.getRed(), rgb.getGreen(), rgb.getBlue());
} else if (color instanceof FSCMYKColor) {
FSCMYKColor cmyk = (FSCMYKColor) color;
_color = new CMYKColor(cmyk.getCyan(), cmyk.getMagenta(), cmyk.getYellow(), cmyk.getBlack());
} else {
throw new RuntimeException("internal error: unsupported color class " + color.getClass().getName());
}
}