Previous Document Next Document

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


Application.CreateHSBColor

Function CreateHSBColor(Hue As Long, Saturation As Long, Brightness As Long) As Color

Description

Member of Application

The CreateHSBColor method creates a color object from the HSB color model.

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. Values range from 0 to 360.
Saturation
Specifies the saturation for the HSB 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 to 255.
Brightness
Specifies the brightness for the HSB color model. Brightness is the intensity (lighter or darker color) or 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. Values range from 0 to 255.

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.