Skip to content

types.color ​

A wrapper class for interacting with colors

Properties ​

NameDescription
WHITEtype: s.color The white color (woah!!)
BLACKtype: s.color The black color (woah!!)
REDtype: s.color The red color (woah!!)
GREENtype: s.color The green color (woah!!)
BLUEtype: s.color The blue color (woah!!)
YELLOWtype: s.color The yellow color (woah!!)
CYANtype: s.color The cyan color (woah!!)
MAGENTAtype: s.color The magenta color (woah!!)
GRAYtype: s.color The gray color (woah!!)
ORANGEtype: s.color The orange color (woah!!)
TRANSPARENTtype: s.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)