Shayton Equilibrium Kitchen Utensil 2003 User Manual

Page of 194
MediaScript Objects and Methods 165 
• 
• 
• 
The global functions, CmykColor, RgbColor, and LoadAsRGB are defined in 
“Sys/color.ms”.
C m y k C o l o r  
This object is constructed from a 32-bit value. It splits the color into cyan, magenta, yellow, 
and black components.
Constructor
CmykColor(value)
 - returns an CmykColor object constructed from value.
Properties
.cyan
 - the cyan component (read or write). Valid values range from 0 to 255.
.magenta
 - the magenta component (read or write). Valid values range from 0 to 255.
.yellow
 - the yellow component (read or write). Valid values range from 0 to 255.
.black
 - the black component (read or write). Valid values range from 0 to 255.
Methods
valueOf()
 - converts the cyan, magenta, yellow, and black components back to a 32-bit 
value.
toString()
 - returns string representation of 32-bit value.
Functions
CmykColorFromCMYK(cyan, magenta, yellow, black)
 - constructs CmykColor 
from the components.
CmykColorFromPct(cyan, magenta, yellow, black)
 - constructs CmykColor 
from component percentages (0-1).
Examples
#include "Sys/color.ms" 
myColor = new CmykColor();
myColor.cyan = 27;
myColor.yellow = 122;
myColor.magenta = 115;
myColor.black = 55;
media = new Media();
media.makeCanvas(xs @ 100, ys @ 100, fillcolor @ myColor);
C O M C r e a t e O b j e c t ( )  
COM objects can be created using a global function.
Parameters
progId
 - specifies a string containing the friendly progID of the COM object.