Previous Document Next Document

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


Color.HLSAssign

Sub HLSAssign(Hue As Long, Lightness As Long, Saturation As Long)

Description

Member of Color

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

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.

The HLS model is a variation of the HSB model and contains three components: hue, lightness, and saturation. Hue determines color (yellow, orange, red, etc.), lightness determines perceived intensity (lighter or darker color), and saturation determines color depth (from dull to intense). The circular visual selector defines the H value (0 to 360) and the S value (0 to 100); the vertical visual selector defines the L value (0 to 100).

Parameter
Description
Hue
Specifies the hue for the HLS 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.
Lightness
Specifies the lightness for the HLS color model. Lightness determines the intensity of the color. Values range from 0 to 100.
Saturation
Specifies the saturation for the HLS 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.

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.HLSAssign 200, 100, 100
End Sub

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.