Sign in Join
FPDoc Onlineexperiment

IncColor function

In unit Graphics

Increases the component RGB values in a color by the specified amount (results in a lighter color overall).

Declaration

pascal
function IncColor(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 increased.

Function result

TColor value with RGB components incremented by the specified amount.

Description

IncColor separates the color specified in AColor into its Red, Green, and Blue component Byte values. It increases each the RGB Byte values by the amount specified in AQuantity with an upper limit of 255 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:

AColor := IncColor(clNavy, 32); // lighten by 12.5%

Use DecColor to decrease (or darken) the RGB component values in a color.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.