Previous Document Next Document

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


Color.HSBAssign

Sub HSBAssign(Hue As Long, Saturation As Long, Brightness As Long)

Description

Member of Color

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

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.

HSB is a color model that approximates the way the human eye perceives color. In the HSB model, color is defined by three components: hue, saturation, and brightness. Hue determines color (yellow, orange, red, etc.), brightness determines perceived intensity (lighter or darker color), and saturation determines color depth (from dull to intense). In the HSB color model, hue (H) is expressed as a degree of rotation on a circular color wheel. Saturation (S) and brightness (B) are expressed as percentages of full intensity.

Parameter
Description
Hue
Specifies the hue for the HSB color model. Hue is the property of a color that allows us to classify it by its name. For example, blue, green, and red are all hues.
Saturation
Specifies the saturation for the HSB color model. Saturation is the purity or vividness of a color, expressed as the absence of white. A color that has 100% saturation contains no white. A color with 0% saturation is a shade of gray.
Brightness
Specifies the brightness for the HSB color model. Brightness is the amount of light that is transmitted or reflected from a given pixel. In the HSB color model, brightness is a measure of how much white a color contains. In this case, a brightness value of 0 produces black and a brightness value of 255 produces white.

VBA example

The following VBA example creates an ellipse on the active layer in the current document.

Sub LayerActive()
 ActiveLayer.CreateEllipse 3, 3, 2, 1
 ActiveDocument.Selection.Shapes(1).Fill.UniformColor.HSBAssign 200, 100, 100
End Sub

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.