Unit RRColors

*********************************************************************** Author: Robert Rossmair Wagelwitz, Rodaer Str. 6 04688 Mutzschen Germany e-mail: Robert.Rossmair@t-online.de Module: RRColors Version: 20-Nov-1997 Compatibility: Delphi 3 Description: SetBitmapColors: Change entries of the DIB color table Some color system conversion stuff { RGB <-> Hue, Saturation, Luminance (HSL) } How does Win95/NT 4 compute the appropriate light and shadow colors of 3D-objects if the face color is given? I'm not sure, but Get3DColors obviously gives correct results thus proving my assumptions to be right. Copyright © 1997 Robert Rossmair Use, modification and distribution is allowed without limitation, warranty, or liability of any kind. If you use this software or portions of it in a commercial program, I would appreciate it if you mentioned my contribution in the documentation materials accompaning your work.

Classes

Functions

GammaCorrection -
Get3DColors - RGB liegt auf der Grauachse
GetBitmapColors -
GetHSL -
GetHSLColor -
HSL2RGB -
RGB2HSL - magenta
SetBitmapColors -

Types

THSLValue
THSLVector

Constants

Variables


Functions


procedure GammaCorrection(Gamma: Single; const Colors: array of TRGBQuad);


procedure Get3DColors(FaceColor: TColor; var HighLightColor, ShadowColor: TColor);

RGB liegt auf der Grauachse

procedure GetBitmapColors( Bmp: TBitmap; var Colors: array of TColor; Index: Integer);


function GetHSL(Color: TColor): THSLVector;


function GetHSLColor(H, S, L: Integer): TColor;


function HSL2RGB(const HSL: T3DVector): T3DVector;


function RGB2HSL(const RGB: T3DVector): T3DVector;

magenta

procedure SetBitmapColors( Bmp: TBitmap; Colors: array of TColor; Index: Integer);


Types


THSLValue = 0..240

THSLVector = record
Hue : THSLValue;
Saturation : THSLValue;
Luminance : THSLValue;
end;

Constants


Variables