All Functions Modules Pages
color

Functions

NIL color.loadpalette ()
 Loads a palette of 17 basic colors, ready to use (see example). Colors are: More...
 
COLOR color.new (NUMBER R, NUMBER G, NUMBER B)
 Creates a new solid color from the specified values (from 0 to 255 for each channel). More...
 
COLOR color.new (NUMBER R, NUMBER G, NUMBER B, NUMBER A)
 Creates a new semitransparent color from the specified values (from 0 to 255 for each channel). More...
 
COLOR color.blend (COLOR c1, COLOR c2)
 Mix two colors. More...
 
COLOR color.mix (COLOR c1, COLOR c2, NUMBER percent1, NUMBER percent2)
 Brief two blend colors using the given percentages. More...
 
COLOR color.add (COLOR c1, COLOR c2)
 IAddition two colors. More...
 
COLOR color.sub (COLOR c1, COLOR c2)
 Subtracts two colors. More...
 
COLOR color.fxgray (COLOR myColor)
 Converts a color to gray scale. More...
 
COLOR color.fxinvert (COLOR myColor)
 Converts a color to its inverted State. More...
 
NUMBER color.r (COLOR myColor)
 Obtains the red channel value of the specified color. More...
 
COLOR color.r (COLOR myColor, NUMBER value)
 Modifies the red channel value of the specified color. More...
 
NUMBER color.g (COLOR myColor)
 Obtains the green channel value of the specified color. More...
 
COLOR color.g (COLOR myColor, NUMBER value)
 Modifies the green channel value of the specified color. More...
 
NUMBER color.b (COLOR myColor)
 Obtains the blue channel value of the specified color. More...
 
COLOR color.b (COLOR myColor, NUMBER value)
 Modifies the blue channel value of the specified color. More...
 
NUMBER color.a (COLOR myColor)
 Obtains the alpha channel value of the specified color. More...
 
COLOR color.a (COLOR myColor, NUMBER value)
 Modifies the alpha channel value of the specified color. More...
 

Detailed Description

Color managing.

Function Documentation

NIL color.loadpalette ( )

Loads a palette of 17 basic colors, ready to use (see example). Colors are:

  • red (255,0,0)
  • green (0,255,0)
  • blue (0,0,255)
  • cyan (0,255,255)
  • magenta (255,0,255)
  • yellow (255,255,0)
  • maroon (127,0,0)
  • grass (0,127,0)
  • navy (0,0,127)
  • turquoise (0,127,127)
  • violet (127,0,127)
  • olive (127,127,0)
  • white (255,255,255)
  • gray (127,127,127)
  • black (0,0,0)
  • orange (255,130,0)
  • chocolate (195,65,0)
    Returns
    Nothing.
COLOR color.new ( NUMBER  R,
NUMBER  G,
NUMBER  B 
)

Creates a new solid color from the specified values (from 0 to 255 for each channel).

Parameters
RRed channel value.
GGreen channel value.
BBlue channel value.
Returns
A color object, ready to use.
COLOR color.new ( NUMBER  R,
NUMBER  G,
NUMBER  B,
NUMBER  A 
)

Creates a new semitransparent color from the specified values (from 0 to 255 for each channel).

Parameters
RRed channel value.
GGreen channel value.
BBlue channel value.
AAlpha channel value (transparency).
Returns
A color object, ready to use.
COLOR color.blend ( COLOR  c1,
COLOR  c2 
)

Mix two colors.

Parameters
c1Color one.
c2Color two.
Returns
A color object, ready to use.
COLOR color.mix ( COLOR  c1,
COLOR  c2,
NUMBER  percent1,
NUMBER  percent2 
)

Brief two blend colors using the given percentages.

Parameters
c1Color one.
c2Color two.
percent1Percentage of Color one.
percent2Percentage of Color two.
Returns
A color object, ready to use.
COLOR color.add ( COLOR  c1,
COLOR  c2 
)

IAddition two colors.

Parameters
c1Color one.
c2Color two.
Returns
A color object, ready to use.
COLOR color.sub ( COLOR  c1,
COLOR  c2 
)

Subtracts two colors.

Parameters
c1Color one.
c2Color two.
Returns
A color object, ready to use.
COLOR color.fxgray ( COLOR  myColor)

Converts a color to gray scale.

Parameters
myColora color to process.
Returns
A color object, ready to use.
COLOR color.fxinvert ( COLOR  myColor)

Converts a color to its inverted State.

Parameters
myColora color to process.
Returns
A color object, ready to use.
NUMBER color.r ( COLOR  myColor)

Obtains the red channel value of the specified color.

Parameters
myColora color to process.
Returns
The red channel value of the specified color.
COLOR color.r ( COLOR  myColor,
NUMBER  value 
)

Modifies the red channel value of the specified color.

Parameters
myColora color to process.
valueThe new value for the red channel.
Returns
A color, with the red channel modified.
NUMBER color.g ( COLOR  myColor)

Obtains the green channel value of the specified color.

Parameters
myColora color to process.
Returns
The green channel value of the specified color.
COLOR color.g ( COLOR  myColor,
NUMBER  value 
)

Modifies the green channel value of the specified color.

Parameters
myColora color to process.
valueThe new value for the green channel.
Returns
A color, with the green channel modified.
NUMBER color.b ( COLOR  myColor)

Obtains the blue channel value of the specified color.

Parameters
myColora color to process.
Returns
The blue channel value of the specified color.
COLOR color.b ( COLOR  myColor,
NUMBER  value 
)

Modifies the blue channel value of the specified color.

Parameters
myColora color to process.
valueThe new value for the blue channel.
Returns
A color, with the blue channel modified.
NUMBER color.a ( COLOR  myColor)

Obtains the alpha channel value of the specified color.

Parameters
myColora color to process.
Returns
The alpha channel value of the specified color.
COLOR color.a ( COLOR  myColor,
NUMBER  value 
)

Modifies the alpha channel value of the specified color.

Parameters
myColora color to process.
valueThe new value for the alpha channel.
Returns
A color, with the alpha channel modified.