Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

See webcolors and custom colors in Delphi's Object Inspector colorpicker at design-time

when designing a form and its components at design-time, some properties of color type allow us to choose colors from a list of predefined default Delphi colors:

enter image description here

double clicking on this property, we can even see a color-picker which lists some additional options and offers the ability to define custom colors.

However, I would like to define a custom palette for my application; that is, to add some of the named clWeb colors to the dropdown list (screenshotted above), maybe even colors that I can name myself.

In short, I would like to make a consistent set of web-colors of my choice to always appear in the dropdown color list when picking colors at design-time in the IDE, so I can color my components in a modern, yet coherent manner.

Themes, while very uniform, are too rigid and introduce weird glitches in places.

Any suggestions?

Delphi 11.3

like image 523
Khorkhe Avatar asked Oct 15 '25 16:10

Khorkhe


1 Answers

I'm not aware about any "ready to use" solution. Anyhow, you could try to create your own property editor and register it in the IDE as the editor for the TColor type.

It could be a little bit complex, but it basically consists in two parts as mentioned before:

  1. Creating the property editor (it should be a TPropertyEditor descendant class)

  2. Registering your property editor as as the editor for the TColor type (you will need to use the RegisterPropertyEditor procedure)

I also suggest you to read these pages:

  • Adding Property Editors
  • How to implement the own custom property editor for all instances of a certain type
  • Custom colors in Delphi 7
like image 85
Fabrizio Avatar answered Oct 18 '25 16:10

Fabrizio



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!