Previous Document Next Document

Object Model Reference : Classes : C : Color : Methods : Color.RGBAssign


Color.RGBAssign

Sub RGBAssign(Red As Long, Green As Long, Blue As Long)

Description

Member of Color

The RGBAssign method assigns the RGB color model in CorelDRAW. All three color components are applied in one step, and the color model is set to RGB.

A color is an effect applied to an object that alters the object’s appearance by the way it reflects light. A color model is a system that defines the number and type of colors that make up an image and that is used to organize and define colors according to a set of basic properties that can be reproduced. Black-and-white, grayscale, RGB, CMYK, and paletted are examples of popular color modes.

RGB is a color mode that contains three components: red (R), green (G), and blue (B). The RGB color mode is based on the RGB color model. In the RGB color mode, a value between 0 and 255 is assigned to each channel of red, green, and blue. An RGB color with the component values 0:25:118, for example, contains no red, some green, and more blue, resulting in a slightly greenish blue color. Monitors, scanners, and the human eye use RGB to produce or detect color.

Parameter
Description
Red
Specifies the level of red in the RGB color model. Values range from 0 to 255.
Green
Specifies the level of green in the RGB color model. Values range from 0 to 255.
Blue
Specifies the level of blue in the RGB color model. Values range from 0 to 255.

VBA example

The following VBA example changes the background color of the current page in the open document to red.

Sub PageActive()
 ActivePage.Color.RGBAssign 255, 0, 0
End Sub

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.