Packed Record THSLAPixel
Unit
Declaration
type THSLAPixel = packed record
Description
Pixel color defined in linear HSL colorspace with gamma correction.
Values range from 0 to 65535. See TGSBAPixel for corrected hue and brightness.
Example drawing all the colors in HSL colorspace:
procedure TForm1.FormPaint(Sender: TObject); var x,y: integer; p: PBGRAPixel; image: TBGRABitmap; hsla: THSLAPixel; begin image := TBGRABitmap.Create(ClientWidth,ClientHeight); hsla.lightness := 32768; hsla.alpha := 65535; for y := 0 to image.Height-1 do begin p := image.Scanline[y]; hsla.saturation := y*65536 div image.Height; for x := 0 to image.Width-1 do begin hsla.hue := x*65536 div image.Width; pˆ:= HSLAToBGRA(hsla); inc(p); end; end; image.InvalidateBitmap; // changed by direct access image.Draw(Canvas,0,0,True); image.free; end;
Overview
Fields
hue: word; |
|
saturation: word; |
|
lightness: word; |
|
alpha: word; |
Methods
class function New(const AHue,ASaturation,ALightness:word): THSLAPixel; overload; static; |
|
class function New(const AHue,ASaturation,ALightness,AAlpha:word): THSLAPixel; overload; static; |
Description
Fields
hue: word; |
|
|
saturation: word; |
|
|
lightness: word; |
|
|
alpha: word; |
|
Opacity of the pixel. 0 is transparent and 65535 is opaque |
Methods
class function New(const AHue,ASaturation,ALightness:word): THSLAPixel; overload; static; |
|
This item has no description. |
class function New(const AHue,ASaturation,ALightness,AAlpha:word): THSLAPixel; overload; static; |
|
This item has no description. |