Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TdxCustomColorGallery.OnGetCustomColorSet Event

In This Article

Enables you to customize palette colors.

#Declaration

Delphi
property OnGetCustomColorSet: TdxColorGetCustomColorSetEvent read; write;

#Remarks

This event is fired only if the ColorSet property is set to csCustom, before the currently selected color palette is populated with colors.

Sender specifies the color gallery.

ASet contains a set of colors to be used for populating the color palette. The number of colors in ASet varies, depending upon the color palette, as described below:

  • For the cpOffice color palette, the set contains 20 colors (including 10 theme colors and 10 standard colors);

  • For the cpExtended and cpStandard color palettes, the set contains 40 and 15 colors, respectively.

You can customize these colors as required to display your own color palettes.

The following code shows how to swap standard and theme colors in the cpOffice color palette:

uses
  ..., dxCore;
//...
procedure <Form>.<dxColorGallery>GetCustomColorSet(Sender: TObject; var ASet: TColors);
const
  ThemeColorCount = 10;
var
  I: Iteger;
  AThemeColor: TColor;
begin
  for I := 0 to ThemeColorCount - 1 do
  begin
    AThemeColor := ASet[I];
    ASet[I] := ASet[I + ThemeColorCount];
    ASet[I + ThemeColorCount] := AThemeColor;
  end;
end;

The image below shows the resulting color palette.

See Also