Object Model Reference : Classes : A : Application : Methods : Application.CreateHLSColor |
Function CreateHLSColor(Hue As Long, Lightness As Long, Saturation As Long) As Color
Member of Application
The CreateHLSColor method creates a new color from the HLS color model.
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 |
Copyright 2013 Corel Corporation. All rights reserved.