Sign in Join
FPDoc Onlineexperiment

TColorDialog class

In unit Dialogs

Implements a dialog used to select a TColor value.

Declaration

pascal
TColorDialog = class(TCommonDialog)

Inheritance

  1. TColorDialog
  2. TCommonDialog
  3. TLCLComponent
  4. TComponent

Description

TColorDialog is a TCommonDialog descendant which implements a dialog used to select a color value from a palette of colors. It is a wrapper for the native color selection dialog on platforms supported by the LCL (when available).

The dialog allows a TColor value to be selected from a group of predefined basic colors, custom colors, or using a color wheel or pad. On some platforms, the color can be specified using RGB or HSL (Hue, Saturation, Luminosity) values.

Use the CustomColors property to define color values using identifiers and hexadecimal RGB values for the custom colors.

Use the Options property to control the features enabled or disabled when the dialog is executed.

Set the value for the Title property (when needed) prior to displaying the color selection dialog.

Call the Execute method to display the color dialog and capture the color value. If the user clicks on the OK button in the dialog, the selected color value is returned in the Color property and the UserChoice property is set to mrOK. A value other than mrOK indicates that the color selection dialog was cancelled or closed without selecting a color value.

See also

Properties

TitlepublishedThe Title or Caption displayed in the title bar for the dialog.
AlphaChannelpublishedIndicates the opacity or transparency for the selected color.
ColorpublishedColor selected by the user in the color dialog.
CustomColorspublishedDefines the color names and values available in the color dialog.
OptionspublishedIndicates the optional features enabled (or disabled) for the color dialog.

Methods

WSRegisterClassprotectedRegisters this component class with the current WidgetSet.
DefaultTitleprotectedGets the default title used in the caption for the color selection dialog.
CreatepublicConstructor for the class instance.
DestroypublicDestructor for the class instance.

Inherited

From TCommonDialog (22)

AttachTo Close DoCanClose DoClose DoExecute DoShow Execute GetHeight GetWidth Handle HandleAllocated Height HelpContext OnCanClose OnClose OnDialogResult OnShow ResetShowCloseFlags SetHeight SetWidth UserChoice Width

From TLCLComponent (7)

DecLCLRefCount GetWSComponentClass IncLCLRefCount LCLRefCount NewInstance RemoveAllHandlersOfObject WidgetSetClass

An experiment, built from Lazarus main 2dfa93c66e of 10-22-2026. Not the official Lazarus documentation.