Skip to main content

sm.color

Associated object type: Color

A color is represented using a red, green, blue and alpha component.
Colors are prominently used for blocks and parts that are colored by the Paint Tool.

To create one, use sm.color.new. It is possible to use hex 0xRRGGBBAA, RGBA 0, 0, 0, 0 or strings "RRGGBBAA".

Functions

new

sm.color.new( r_hex, g, b, a )

Creates a new color object.

Arguments:
  • r_hex [ number/string/hexInt ]: The red value if using RGBA OR the hex string OR the hex int.
  • g [ number ]: The green value, if using RGBA.
  • b [ number ]: The blue value, if using RGBA.
  • a [ number ]: The alpha value, if using RGBA (optional).
Returns:
  • [ Color ]: The created color object.