Updated: Dec 16, 2023
Follow on twitter

How to aquire colors from active skin?

Each skin has two sets of colors: common colors and own colors for each skin section.

  • Common colors may be accessed via the public TsSkinManager.Palette array. List of indexes for this array may be found on this page. For example, here is a receiving of the main color of skin:
    MainColor := sSkinManager1.Palette[pcMainColor];
  • Each skin section has own colors for different states of control. Let's receive a color of edit controls, for example:
    var SectionIndex: integer; begin // Search index of section in the current loaded skin SectionIndex := sSkinManager1.GetSkinIndex('EDIT'); if SectionIndex >= 0 then begin // Be sure that section is existing State := 0; // Normal state ColorNorm := sSkinManager1.gd[SectionIndex].Props[State].Color; // Normal control color State := 1; // Active state ColorFocused := sSkinManager1.gd[SectionIndex].Props[State].Color; // Focused control color end; end;
  • If controls rendered with gradient or texture filling then colors may be not defined by designer of skin. The main color of skin may be used in this case (or other, it's depended from purposes of color receiving.






Installing, using and licensing the demo programs © Sergii Goncharov, Ukraine, Odessa 2004-2023