Skip to content

types.color

A wrapper class for interacting with colors

Properties

NameDescription
WHITEtype: color The white color (woah!!)
BLACKtype: color The black color (woah!!)
REDtype: color The red color (woah!!)
GREENtype: color The green color (woah!!)
BLUEtype: color The blue color (woah!!)
YELLOWtype: color The yellow color (woah!!)
CYANtype: color The cyan color (woah!!)
MAGENTAtype: color The magenta color (woah!!)
GRAYtype: color The gray color (woah!!)
ORANGEtype: color The orange color (woah!!)
TRANSPARENTtype: color The transparent color (woah!!)
redtype: number The red color channel
greentype: number The green color channel
bluetype: number The blue color channel
alphatype: number The alpha color channel

Functions

new(red : number, green : number, blue : number, opt_alpha : number): types.color

Creates a new color instance

  • red (number) The red color channel
  • green (number) The green color channel
  • blue (number) The blue color channel
  • opt_alpha (number) (optional) The alpha color channel
  • returns (types.color) A new color instance

with_alpha(alpha : number): types.color

Sets the color's alpha and returns it

  • alpha (number) The alpha from 0 to 255
  • returns (types.color)