Partager via


RGBColor.RGB Property (PowerPoint)

Returns or sets the red-green-blue (RGB) value of a specified color-scheme color or extra color when used with a PpColorSchemeIndex constant. Read/write.

Syntax

expression .RGB

expression A variable that represents a RGBColor object.

Return Value

MsoRGBType

Remarks

Use the Colors method to return a RGBColor object.

The value of the RGB property can be one of these PpColorSchemeIndex constants.

ppAccent1

ppAccent2

ppAccent3

ppBackground

ppFill

ppForeground

ppShadow

ppTitle

Example

This example displays the value of the red, green, and blue components of the fill forecolor for shape one on slide one in the active document.

Set myDocument = ActivePresentation.Slides(1)

c = myDocument.Shapes(1).Fill.ForeColor.RGB

redComponent = c Mod 256

greenComponent = c \ 256 Mod 256

blueComponent = c \ 65536 Mod 256

MsgBox "RGB components: " & redComponent & _

    ", " & greenComponent & ", " & blueComponent

See Also

Concepts

RGBColor Object Members

RGBColor Object