User's Manual

MediaScript Objects and Methods 165
The global functions, CmykColor, RgbColor, and LoadAsRGB are defined in
Sys/color.ms”.
CmykColor
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);
COMCreateObject()
COM objects can be created using a global function.
Parameters
progId - specifies a string containing the friendly progID of the COM object.