RGB Property
Applies To
ColorFormat object, RGBColor object.
Description
ColorFormat object: Returns or sets the red-green-blue (RGB) value of the specified color. Read/write Long.
RGBColor object: Returns or sets the red-green-blue (RGB) value of the specified color-scheme color or extra color. Read/write Long.
Example
This example sets the background color for color scheme three in the active presentation and then applies the color scheme to all slides in the presentation that are based on the slide master.
With ActivePresentation
Set cs1 = .ColorSchemes(3)
cs1.Colors(ppBackground).RGB = RGB(128, 128, 0)
.SlideMaster.ColorScheme = cs1
End With
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