-
Notifications
You must be signed in to change notification settings - Fork 117
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.
Modify the Hue, Saturation and Lightness for the visual elements and fonts of the VCL Styles.
Change the values of the RGB components for the visual elements and fonts of the VCL Styles.
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.
Check this form with the Carbon style applied.
//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