SetRGB Method

Sets the color scheme to RGB and initializes the color components with the specified values.

Applies to: Color object, ColorEntry object

Syntax

object.SetRGB ( red, green, blue )

The SetRGB method syntax has these parts:

Part Description
object Required. An expression that returns an instance of an object in the Applies to list.
red Required. An expression that returns an Integer value. The value of the red component.
green Required. An expression that returns an Integer value. The value of the green component.
blue Required. An expression that returns an Integer value. The value of the blue component.

Remarks

After the SetRGB method has been called, the color is converted to the RGB format regardless of its previous format. The values of the red, green and blue can be in the range of 0 to 255, and are used to set respective components of the color.

Example

This example contains a document-level script. It demonstrates how to change the fill color of a rectanlge in RGB format.

dim s as shape

' Create a Shape object
s = thisDoc.ActivePage.DrawRect(100,100,1000,1000)
s.FillColor.SetRGB(30,230,178) ' Change the Shape's fill color in RGB format s.PropertyChanged(CDPT_FILLCOLOR)

 

See Also

SetCMYK method