2011-07-18 07:00:37 -04:00
|
|
|
.. _scriptref-colourconv:
|
2010-09-03 17:22:31 -04:00
|
|
|
|
|
|
|
Colour Conversions
|
|
|
|
==================
|
|
|
|
|
2011-07-18 07:00:37 -04:00
|
|
|
..
|
|
|
|
TODO:
|
|
|
|
|
2011-03-11 05:39:23 -05:00
|
|
|
Colour spaces
|
|
|
|
-------------
|
|
|
|
|
|
|
|
Explain some colour spaces here.
|
|
|
|
|
|
|
|
|
|
|
|
Colour Conversion Methods
|
|
|
|
-------------------------
|
|
|
|
|
2011-07-18 07:00:37 -04:00
|
|
|
.. _scriptref-colortorgb:
|
2011-03-11 05:42:44 -05:00
|
|
|
|
|
|
|
ColorToRGB
|
|
|
|
~~~~~~~~~~
|
|
|
|
|
2011-03-11 05:39:23 -05:00
|
|
|
.. code-block:: pascal
|
|
|
|
|
|
|
|
procedure ColorToRGB(Color: integer; var r, g, b: Integer);
|
|
|
|
|
2011-07-18 07:00:37 -04:00
|
|
|
.. _scriptref-rgbtocolor:
|
|
|
|
|
2011-03-11 05:39:23 -05:00
|
|
|
RGBtoColor
|
|
|
|
~~~~~~~~~~
|
|
|
|
|
|
|
|
.. code-block:: pascal
|
|
|
|
|
|
|
|
function RGBtoColor(r, g, b: Integer): TColor;
|
|
|
|
|
2011-07-18 07:00:37 -04:00
|
|
|
.. _scriptref-colortohsl:
|
|
|
|
|
2011-03-11 05:39:23 -05:00
|
|
|
ColorToHSL
|
|
|
|
~~~~~~~~~~
|
|
|
|
|
|
|
|
.. code-block:: pascal
|
|
|
|
|
|
|
|
procedure ColorToHSL(Color: Integer; var h, s, l: Extended);
|
|
|
|
|
2011-07-18 07:00:37 -04:00
|
|
|
.. _scriptref-hsltocolor:
|
|
|
|
|
2011-03-11 05:39:23 -05:00
|
|
|
HSLToColor
|
|
|
|
~~~~~~~~~~
|
|
|
|
|
|
|
|
.. code-block:: pascal
|
|
|
|
|
|
|
|
function HSLToColor(H, S, L: Extended): TColor;
|
|
|
|
|
2011-07-18 07:00:37 -04:00
|
|
|
.. _scriptref-colortoxyz:
|
|
|
|
|
2011-03-11 05:39:23 -05:00
|
|
|
ColorToXYZ
|
|
|
|
~~~~~~~~~~
|
|
|
|
|
|
|
|
.. code-block:: pascal
|
|
|
|
|
|
|
|
procedure ColorToXYZ(Color: Integer; var x, y, z: Extended);
|
|
|
|
|
2011-07-18 07:00:37 -04:00
|
|
|
.. _scriptref-xyztocolor:
|
|
|
|
|
2011-03-11 05:39:23 -05:00
|
|
|
XYZToColor
|
|
|
|
~~~~~~~~~~
|
|
|
|
|
|
|
|
.. code-block:: pascal
|
|
|
|
|
|
|
|
function XYZToColor(X, Y, Z: Extended): TColor;
|
|
|
|
|
2011-07-18 07:00:37 -04:00
|
|
|
.. _scriptref-rgbtohsl:
|
|
|
|
|
2011-03-11 05:39:23 -05:00
|
|
|
RGBToHSL
|
|
|
|
~~~~~~~~
|
|
|
|
|
|
|
|
.. code-block:: pascal
|
|
|
|
|
|
|
|
procedure RGBToHSL(R, G, B: Integer; var h, s, l: Extended);
|
|
|
|
|
2011-07-18 07:00:37 -04:00
|
|
|
.. _scriptref-hsltorgb:
|
|
|
|
|
2011-03-11 05:39:23 -05:00
|
|
|
HSLtoRGB
|
|
|
|
~~~~~~~~
|
|
|
|
|
|
|
|
.. code-block:: pascal
|
|
|
|
|
|
|
|
procedure HSLtoRGB(H, S, L: extended; var R, G ,B: Integer);
|
|
|
|
|
2011-07-18 07:00:37 -04:00
|
|
|
.. _scriptref-rgbtoxyz:
|
|
|
|
|
2011-03-11 05:39:23 -05:00
|
|
|
RGBToXYZ
|
|
|
|
~~~~~~~~
|
|
|
|
|
|
|
|
.. code-block:: pascal
|
|
|
|
|
|
|
|
procedure RGBToXYZ(R, G, B: Integer;var x, y ,z: Extended);
|
|
|
|
|
2011-07-18 07:00:37 -04:00
|
|
|
.. _scriptref-xyztorgb:
|
|
|
|
|
2011-03-11 05:39:23 -05:00
|
|
|
XYZToRGB
|
|
|
|
~~~~~~~~
|
|
|
|
|
|
|
|
.. code-block:: pascal
|
|
|
|
|
|
|
|
procedure XYZToRGB(X, Y, Z: Extended; var R, G, B: Integer);
|
|
|
|
|
2011-07-18 07:00:37 -04:00
|
|
|
..
|
|
|
|
TODO: Add CIE L*a*b.
|