GetRed Method

An Integer value. Gets the value of the red component of the color regardless of the color scheme of the object.

Applies to objects: Color

Syntax

[[Let] ret =] object.GetRed (Doc)

The GetRed method syntax has these parts:

Part Description
object A reference to an instance of the object.
Doc A reference to an instance of the Document object.
ret An Integer type variable (range 0 - 255).

Remarks

You can also use the Red propery to get the value of the red component of the object's color. However, that property is only effective if the color of objeñt is in the RGB format. For correct transformation of an indexed color to the RGB or CMYK format for the specified document, the Doc parameter is used in the GetRed method.

Example

This example shows how to find out the value of the red component of a rectangle's fill color (the color was specified in the CMYK format).

dim s as shape

' Create Shape object
s = thisDoc.ActivePage.DrawRect(100,100,1000,1000)
s.FillColor.SetCMYK(30,10,70,35) ' Change fill color in CMYK format s.PropertyChanged(CDPT_FILLCOLOR) trace s.FillColor.GetRed(thisDoc) ' Display the value of the red component

 

See Also

Color Object