Clamp

function Clamp(const Value: Integer): TColor32; overload;

function Clamp(Value: Integer; Max: Integer): Integer; overload;

function Clamp(Value: Integer; Min: Integer; Max: Integer): Integer; overload;

Description

First version restricts Value to [0..255] range.

Second version restricts Value to [0..Max] range.

Third version restricts Value to [Min..Max] range.

This function is used in TWrapMode wmClamp.

See Also

TWrapMode, Mirror, Wrap