
|
ApplyDark function
function ApplyDark(Color: TColor; HowMuch: Byte): TColor;
Unit
TeCanvas
Description
The ApplyDark function converts the Color parameter to a darker color.
The HowMuch parameter indicates the quantity of dark increment.
It is used by TBarSeries and TPieSeries to calculate the right color to draw Bar sides and TPieSeries 3D zones.
The TeCanvas unit must be in your uses clause.
This is the ApplyDark source code:
Function ApplyDark(Color:TColor; HowMuch:Byte):TColor;
Var r,g,b:Byte;
begin
Color:=ColorToRGB(Color);
r:=GetRValue(Color);
g:=GetGValue(Color);
b:=GetBValue(Color);
if r>HowMuch then r:=r-HowMuch else r:=0;
if g>HowMuch then g:=g-HowMuch else g:=0;
if b>HowMuch then b:=b-HowMuch else b:=0;
result:=RGB(r,g,b);
end;
Example:
Series1.Color := ApplyDark( Series1.Color, 128 );
Send us Help Feedback. Copyright 1995-2024 © by Steema Software. All Rights Reserved.