Previous Document Next Document

Object Model Reference : Classes : A : Application : Methods : Application.CreateHLSColor


Application.CreateHLSColor

Function CreateHLSColor(Hue As Long, Lightness As Long, Saturation As Long) As Color

Description

Member of Application

The CreateHLSColor method creates a new color from the HLS color model.

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. Values range from 0 to 360.
Lightness
Specifies the lightness for the HLS color model. Lightness determines the intensity of the color. Values range from 0 to 255.
Saturation
Specifies the saturation for the HLS color model. Saturation is the purity, vividness, or color depth (from dull to intense) 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. Values range from 0 (0%) to 255 (100%).

Example

Here is a code example:

Sub CreateColorExample()
CreateDocument
Dim sFace As Shape
Set sFace = ActiveLayer.CreateEllipse(1, 10, 8, 1.5)
sFace.Fill.UniformColor = CreateCMYKColor(0, 0, 100, 0) 'Create a yellow fill
Dim sEyeLeft As Shape
Set sEyeLeft = ActiveLayer.CreateEllipse2(3.25, 7.25, 1, -1)
sEyeLeft.Fill.UniformColor = CreateBWColor(True) 'Create a white fill
Dim sEyeRight As Shape
Set sEyeRight = ActiveLayer.CreateEllipse2(6, 7, 1, -1)
sEyeRight.Fill.UniformColor = CreateRGBColor(255, 255, 255) 'Create a white fill
Dim sEyeLeftPupil As Shape
Set sEyeLeftPupil = ActiveLayer.CreateEllipse2(3.5, 7, 0.35, -0.4)
sEyeLeftPupil.Fill.UniformColor = CreateBWColor(False)
Dim sEyeRightPupil As Shape
Set sEyeRightPupil = sEyeLeftPupil.Clone
sEyeRightPupil.Fill.ApplyFountainFill CreateHSBColor(210, 10, 10), CreateGrayColor(72), cdrConicalFountainFill
sEyeRightPupil.Move 2.75, -0.35
Dim sNose As Shape
Set sNose = ActiveLayer.CreateEllipse2(4.3, 5.4, -0.75, -0.5)
sNose.Rotate -10
sNose.Fill.ApplyFountainFill CreateCMYColor(0, 255, 255), CreateHLSColor(0, 75, 75), cdrRadialFountainFill
Dim sMouth As Shape
Set sMouth = ActiveLayer.CreateEllipse2(4.2, 3.75, 1.75, 0.75, 0, 180, True)
sMouth.Rotate -15
sMouth.Fill.ApplyFountainFill CreateYIQColor(97, 97, 100), CreateLabColor(215, -1, -2), cdrSquareFountainFill
End Sub

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.