From 1ad72d5276b1876bf218336a1ff47f086a0834c9 Mon Sep 17 00:00:00 2001 From: scuri Date: Thu, 24 Jun 2010 20:32:39 +0000 Subject: *** empty log message *** --- html/en/func/color.html | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'html/en/func/color.html') diff --git a/html/en/func/color.html b/html/en/func/color.html index fbd4b52..de8216a 100644 --- a/html/en/func/color.html +++ b/html/en/func/color.html @@ -36,19 +36,19 @@ CD_DARK_GRAY = (128,128,128) CD_GRAY = (192,192,192)
-
long int cdEncodeColor(unsigned char red, unsigned char green, unsigned char blue) [in C]
+    
long int cdEncodeColor(unsigned char red, unsigned char green, unsigned char blue) [in C]
 
 cd.EncodeColor(r, g, b: number) -> (old_color: lightuserdata) [in Lua]

Returns a codified triple (r,g,b) in a long integer such as 0x00RRGGBB, where RR are the red components, GG are the green ones and BB are the blue ones. The code is used in the CD library to define colors. It can be used without an active canvas.

-
void cdDecodeColor(long int color, unsigned char *red, unsigned char *green, unsigned char *blue) [in C]
+    
void cdDecodeColor(long int color, unsigned char *red, unsigned char *green, unsigned char *blue) [in C]
 
 cd.DecodeColor(color: lightuserdata) -> (r, g, b: number) [in Lua]

Returns the red, green and blue components of a color in the CD library. Can be used without an active canvas.

-
long int cdEncodeAlpha(long int color, unsigned char alpha) [in C]
+    
long int cdEncodeAlpha(long int color, unsigned char alpha) [in C]
 
 cd.EncodeAlpha(color: lightuserdata, alpha: number) -> (color: lightuserdata) [in Lua]

Returns the given color coded with the alpha information. ATENTION: At the @@ -60,40 +60,40 @@ cd.EncodeAlpha(color: lightuserdata, alpha: number) -> (color: lightuserdata) must be 0 and opaque for backward compatibility, so you should use the cdDecodeAlpha function or the cdAlpha macro to retrieve the alpha component. 0 is transparent, 255 is opaque.

-
unsigned char cdDecodeAlpha(long int color) [in C]
+    
unsigned char cdDecodeAlpha(long int color) [in C]
 
 cd.DecodeAlpha(color: lightuserdata) -> (a: number) [in Lua]

Returns the alpha component of a color in the CD library. Can be used without an active canvas. 0 is transparent, 255 is opaque.

-
unsigned char cdAlpha(long int color); [in C]
+    
unsigned char cdAlpha(long int color); [in C]
 
 cd.Alpha(color: lightuserdata) -> (r: number) [in Lua]

Macro that returns the alpha component of a color in the CD library. Can be used without an active canvas.

-
unsigned char cdRed(long int color); [in C]
+    
unsigned char cdRed(long int color); [in C]
 
 cd.Red(color: lightuserdata) -> (r: number) [in Lua]

Macro that returns the red component of a color in the CD library. Can be used without an active canvas.

-
unsigned char cdGreen(long int color); [in C]
+    
unsigned char cdGreen(long int color); [in C]
 
 cd.Green(color: lightuserdata) -> (g: number) [in Lua]

Macro that returns the green component of a color in the CD library. Can be used without an active canvas.

-
unsigned char cdBlue(long int color); [in C]
+    
unsigned char cdBlue(long int color); [in C]
 
 cd.Blue(color: lightuserdata) -> (b: number) [in Lua]

Macro that returns the blue component of a color in the CD library. Can be used without an active canvas.


-
int cdCanvasGetColorPlanes(cdCanvas* canvas); [in C]
+    
int cdCanvasGetColorPlanes(cdCanvas* canvas); [in C]
 
 canvas:GetColorPlanes() -> (bpp: number) [in Lua]

Returns a given number, for instance p, which defines the number of colors supported by the current device as 2p, representing the number of bits by pixel.

-
void cdCanvasPalette(cdCanvas* canvas, int n, const long int *color, int mode); [in C]
+    
void cdCanvasPalette(cdCanvas* canvas, int n, const long int *color, int mode); [in C]
 
 canvas:Palette(palette: cdPalette; mode: number) [in Lua]

In systems limited to 256 palette colors, this function aims at adding  @@ -104,15 +104,15 @@ canvas:Palette(palette: cdPalette; mode: number) [in Lua]

since the menus and dialogues may be in illegible colors, but there will be more colors available. CD_POLITE is the recommended type. It must always be used before drawing. It cannot be queried.

- +

Palette

-
cd.CreatePalette(size: number) -> (palette: cdPalette) [in Lua Only]
+
cd.CreatePalette(size: number) -> (palette: cdPalette) [in Lua Only]

Creates a palette.

-
cd.KillPalette(palette: cdPalette) [in Lua Only]
+
cd.KillPalette(palette: cdPalette) [in Lua Only]

Destroys the created palette and liberates allocated memory. If this function is not called in Lua, the garbage collector will call it.

- +

Palette Data Access

Data access in Lua is done directly using the array access operators. The -- cgit v1.2.3