Skip to content

VclStylesUtils

Rodrigo Ruz edited this page Mar 27, 2019 · 3 revisions

The Vcl.Styles.Utils unit contain a set classes to modify the VCL Styles in run-time manipulating the visual elements and fonts.

Currently all these operations are supported.

HSL

Modify the Hue, Saturation and Lightness for the visual elements and fonts of the VCL Styles.

https://github.com/RRUZ/vcl-styles-utils/blob/master/images/EqualizerHSL.png

RGB

Change the values of the RGB components for the visual elements and fonts of the VCL Styles.

https://github.com/RRUZ/vcl-styles-utils/blob/master/images/EqualizerRGB.png

Blend

Use any color and available blend effect (Burn, Additive, Dodge, Overlay, Difference, Lighten, Darken, Screen) to customize the visual elements and fonts colors of the VCL Styles.

https://github.com/RRUZ/vcl-styles-utils/blob/master/images/EqualizerBlend.png

Check this form with the Carbon style applied.

https://github.com/RRUZ/vcl-styles-utils/blob/master/images/CarbonSimple.png

//This code shows how you can add a Overlay blend effect to an existing vcl style
//and then apply the changes in run-time.
procedure TFrmMain.FormCreate(Sender: TObject);
var
  VclStylesUtils : TVclStylesUtils;
  Filters        : TObjectList<TBitmapFilter>;
begin
  //create the instance to the  TVclStylesUtils using the carbon vcl style
  VclStylesUtils:=TVclStylesUtils.Create('Carbon');
  //create the filter list to apply
  Filters:=TObjectList<TBitmapFilter>.Create;
  try
    //create a TBitmap32BlendOverlay filter and add to the list
    Filters.Add(TBitmap32BlendOverlay.Create(clYellow));
    //set the elements to be affected
    VclStylesUtils.Elements:=VclStylesUtils.Elements+ [vseBitmaps ,vseSysColors, vseStyleColors];
    //set the filters
    VclStylesUtils.SetFilters(Filters);
    //Apply the changes to the style
    VclStylesUtils.ApplyChanges;
    //reload the modified style
    TStyleManager.ReloadStyle('Carbon');
  finally
    VclStylesUtils.Free;
    Filters.Free;
  end;
end;

And this is the result after of apply the above code

https://github.com/RRUZ/vcl-styles-utils/blob/master/images/CarbonSimple_After.png

Videos

Clone this wiki locally