API Documentation > CorelDRAW > 2025-v26 > Color > IVGColor
Color.ConvertToHSB method
Converts the color model to HSB
Syntax:
Sub ConvertToHSB()
Remarks:
The ConvertToHSB method converts the active color model to the HSB 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. HSB is a color model that approximates the way the human eye perceives color. In the HSB model, color is defined by three components: hue, saturation, and brightness. Hue determines color (yellow, orange, red, etc.), brightness determines perceived intensity (lighter or darker color), and saturation determines color depth (from dull to intense). In the HSB color model, Hue (H) is expressed as a degree of rotation on a circular color wheel. Saturation (S) and brightness (B) are expressed as percentages of full intensity.
Examples:
The following VBA example decreases the saturation of all of the active shape objects on page by half.
Sub Test()
Dim s As Shape
For Each s In ActivePage.Shapes
  If s.Fill.Type = cdrUniformFill Then

 If s.Fill.UniformColor.Type <> cdrColorHSB Then


s.Fill.UniformColor.ConvertToHSB


s.Fill.UniformColor.HSBSaturation = s.Fill.UniformColor.HSBSaturation / 2

 End If
  End If
Next s 
End Sub