public static float[] GetColorArray(BaseColor color)
{
int type = ExtendedColor.GetType(color);
switch (type) {
case ExtendedColor.TYPE_GRAY: {
return new float[]{((GrayColor)color).Gray};
}
case ExtendedColor.TYPE_CMYK: {
CMYKColor cmyk = (CMYKColor)color;
return new float[]{cmyk.Cyan, cmyk.Magenta, cmyk.Yellow, cmyk.Black};
}
case ExtendedColor.TYPE_SEPARATION: {
return new float[]{((SpotColor)color).Tint};
}
case ExtendedColor.TYPE_RGB: {
return new float[]{color.R / 255f, color.G / 255f, color.B / 255f};
}
}
ThrowColorSpaceError();
return null;
}