Site icon Learn C++

Quick Look At Basic Color Components On Windows In C++ Builder (QuickLook Part 6)

This article is about Color Components which is used to select or display Colors. If you are new to ARGB color please refer to this article about Colors in Modern C++

ColorButton (TColorButton)
It is a standard button that displays a color. It can be used to pop up color picker window then backs with selected color. May be to show foreground background colors, etc. It can be used with OnClick() event as in this example below that changes its color randomly on every click;

[crayon-6622738eb7422608572869/]

ColorBox (TColorBox)
Represents a rectangular-shaped color indicator. This box can be used to show selected color.

[crayon-6622738eb742b288138851/]

ColorComboBox (TColorComboBox)
ColorComboBox shows a combo box that allows you to select a color from a color palette. This example below sets Color of a ColorBox when the Color of ColorListBox is changed;

[crayon-6622738eb742d460247239/]

ColorListBox (TColorListBox)
ColorListBox is a combo box that allows you to select an alpha color from a color spectrum, so users can easily select

[crayon-6622738eb742f973881073/]

ColorPicker (TColorPicker)
Color picker shows a color selector that displays the entire color spectrum. Aย TColorPickerย component is a color selector that displays a color spectrum and lets you pick any color by moving a dot-style selector.ย TColorPickerย can be attached to aย TColorQuadย component. It is used with OnChange() event to set selected color to another things as below

[crayon-6622738eb7430737171309/]

ColorPanel (TColorPanel)
ColorPanel is a color selector component complete with alpha channel selection. Aย TColorPanelย component is a color selector that displays a color spectrum represented as aย THueTrackBar, anย alpha channel track barย selector, and aย color quad. These make theย TColorPanelย component a great color selector.

[crayon-6622738eb7432497600453/]

ColorQuad (TColorQuad)
TColorQuadย component is generally attached to TColorPicker to show shades of selected colors. In this way, every time you change theย Colorย in this color picker, the color quad component automatically updates to the color selected in the color picker, further allowing you to tweak the saturation and luminance.

[crayon-6622738eb7436261847641/]
Exit mobile version