FOM Reference > Formatting > Datatypes > fColor interface
  
fColor interface
This object represents a basic color.
ColorTypes enumeration
The type of color.
The ColorTypes enumeration has the following constants of type int.
COLOR_NONE = 0
This is color "none".
COLOR_RGB = 1
This is an RGB color.
COLOR_CMYK = 2
This is a CMYK color.
COLOR_PALETTE = 3
This is a palette color.
ColorModes enumeration
The format to use when outputting the color.
The ColorModes enumeration has the following constants of type int.
MODE_BRACE = 0
Output the color in the form "{a,b,c}"
MODE_FUNC_255 = 1
Output the color in the form "func(a,b,c)" where each value is in the range 0 - 255.
MODE_FUNC_PERC = 2
Output the color in the form "func(a%,b%,c%)" where each value is a percentage.
MODE_HASH = 3
Output the color in the form "#aabbcc" where each value is a hex digit in the range 0x00 - 0xFF.
black attribute
The black component of the color. If the color is not of type COLOR_CMYK, this property will be an approximate value after converting it to this type.
black
Access
read-write
Returns
float
blue attribute
The blue component of the color. If the color is not of type COLOR_RGB, this property will be an approximate value after converting it to this type.
blue
Access
read-write
Returns
float
colorType attribute
The type of color this is. If the color is of type COLOR_PALETTE, all the component properties will be read only. Value is one of fColor.ColorType.
colorType
Access
read-only
Returns
int
cyan attribute
The cyan component of the color. If the color is not of type COLOR_CMYK, this property will be an approximate value after converting it to this type.
cyan
Access
read-write
Returns
float
green attribute
The green component of the color. If the color is not of type COLOR_RGB, this property will be an approximate value after converting it to this type.
green
Access
read-write
Returns
float
magenta attribute
The magenta component of the color. If the color is not of type COLOR_CMYK, this property will be an approximate value after converting it to this type.
magenta
Access
read-write
Returns
float
name attribute
The name of the color if it was created from a color book or palette color. Note that this property will be reset if any of the color component properties are modified.
name
Access
read-only
Returns
String
overprint attribute
If true, this color is marked as an overprint color when printing.
overprint
Access
read-write
Returns
boolean
red attribute
The red component of the color. If the color is not of type COLOR_RGB, this property will be an approximate value after converting it to this type.
red
Access
read-write
Returns
float
yellow attribute
The yellow component of the color. If the color is not of type COLOR_CMYK, this property will be an approximate value after converting it to this type.
yellow
Access
read-write
Returns
float
fColor method
Creates a new fColor object using the specified format string.
fColorcolor
Parameters
Stringcolor
A string representing the color to create.
Returns
fColor. A new object of class fColor.
readResolve method
Return the object corresponding to the given serialized representation.
readResolveobj
Parameters
Objectobj
The serialized representation.
Returns
fColor. The object corresponding to the serialized representation.
toCMYK method
Outputs this color as a string, temporarily converting it to CMYK if necessary.
toCMYKmode
Parameters
intmode
The format to write the color as. Value is one of fColor.ColorMode.
Returns
String. The string representation of this color expressed as an CMYK color.
toRGB method
Outputs this color as a string, temporarily converting it to RGB if necessary.
toRGBmode
Parameters
intmode
The format to write the color as. Value is one of fColor.ColorMode.
Returns
String. The string representation of this color expressed as an RGB color.
toString method
Outputs this color as a string, using the correct form depending upon the color type.
toString
Parameters
None
Returns
String. The string representation of this color.
writeReplace method
Create a serializable representation of this object.
writeReplace
Parameters
None
Returns
Object. A serializable representation of this object.