[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] | Reference for unit 'Graphics' (#lcl)

# DecColor

Decreases the component RGB values in a color by the specified amount (results in a darker color overall).

## Declaration

Source position: graphics.pp line 1938

`function DecColor(`
`AColor: TColor;`
`AQuantity: Byte`
`):TColor;`

## Arguments

`AColor` |  | TColor value with the original color modified in the function.
`AQuantity` |  | The amount by which the separate RGB values in AColor are decreased.

## Function result

TColor value with RGB components decremented by the specified amount.

## Description

DecColor separates the color specified in AColor into its Red, Green, and Blue component Byte values. It decreases each the RGB Byte values by the amount specified in AQuantity with a lower limit of 0 for each of the Byte values. The modified RGB Byte values are reassembled using RGBToColor to form the return value for the routine.

For example:

    DkSkyBlue := DecColor(clSkyBlue, 32); // darken by 12.5%
    DkKhaki := DecColor(TColor($8CE6F0), 40); // darken custom color

Use IncColor to increase (or lighten) the RGB component values in a color.

## See also

RedGreenBlue |  | RedGreenBlue - decomposes a composite color into its component Red, Green and Blue values.
RGBToColor |  | Combines the values for Red, Green and Blue into a TColor value.
IncColor |  | Increases the component RGB values in a color by the specified amount (results in a lighter color overall).