140просмотров
4 января 2026 г.
📷 ФотоScore: 154
Сделать цвет темнее или светлее Мега полезные функции. Рекомендую: function Darker(Color: TColor; Percent: Byte): TColor;
var r, g, b: Byte;
begin r := GetRValue(Color); g := GetGValue(Color); b := GetBValue(Color); r := r-muldiv(r, Percent, 100); g := g-muldiv(g, Percent, 100); b := b-muldiv(b, Percent, 100); Result := RGB(r, g, b);
end; function Lighter(Color: TColor; Percent: Byte):TColor;
var r, g, b: Byte;
begin r := GetRValue(Color); g := GetGValue(Color); b := GetBValue(Color); r := r+muldiv(255-r, Percent, 100); g := g+muldiv(255-g, Percent, 100); b := b+muldiv(255-b, Percent, 100); Result := RGB(r, g, b);
end;