Previous Document Next Document

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


Color.ConvertToHLS

Sub ConvertToHLS()

Description

Member of Color

The ConvertToHLS method converts the active color model to the HLS color model in CorelDRAW.

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).

VBA example

The following VBA example converts all uniform fill colors in the selected shapes to the HLS color model.

Sub Test()
 Dim c As New color
 Dim s As Shape
 For Each s In ActiveSelection.Shapes
  If s.Fill.Type = cdrUniformFill Then
   s.Fill.UniformColor.ConvertToHLS
  End If
 Next s
End Sub

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.