Shayton Equilibrium Kitchen Utensil 2003 Manuale Utente

Pagina di 194
62 
 Chapter 3 
• 
• 
• 
This example converts the color (red) to the colorspace defined by the profile embedded in 
image. If image has no embedded profile, an exception is thrown. Assuming the image is 
a cmyk image with an embedded profile, the resulting color will be the rgb color 
corresponding to color. 
NOTE: 
If a Color Profile is associated with an RGB image, this is considered unnecessary data and 
by default the attached profiles will not be saved to RGB images.
For more information, please see Appendix B, “MediaRich Color Management.”. 
c o l o r T o I m a g e ( )
The specified color is converted from the colorspace defined by the source profile to the 
colorspace defined by the destination profile and returned to the caller. By default, the 
destination profile is the profile embedded in the image. The specified rendering intent is 
used for the conversion. A destination profile may be supplied, and will be used if the 
image has no embedded profile or if the OverrideEmbedded parameter is specified as true. 
Syntax
colorToImage(
color @ <color in hexadecimal, rgb, or cmyk>
[destProfile @ <"filename.icc">]
[sourceProfile @ <"filename.icc">]
[intent @ <"rendering intent">
);
Parameters
color
 - specifies the to color to convert using its hexadecimal or rgb value. 
sourceProfile
 - specifies the profile used for the source colorspace. 
destProfile
 - specifies the profile used for the destination colorspace if the image has no 
embedded profile or if the overrideembedded flag is set to true. 
NOTE: 
For more information, see the section about specifying ICC profiles in 
intent
 - the rendering intent to use for the conversion. This is an optional parameter.
Example
cmykcolor = image.colorToImage(color @ 0xaa0000, 
SourceProfile @ "rgb"); 
This example converts the color (red) to the colorspace defined by the profile embedded in 
image. If image has no embedded profile, an exception is thrown. Assuming the image is 
a CMYK image with an embedded profile, the resulting color will be the CMYK color 
corresponding to color. 
For more information, please see Appendix B, “MediaRich Color Management.”.