Class:SmartestRgbColor

From The Smartest Wiki
Jump to: navigation, search

SmartestRgbColor is a class, used for storing colours, that is one of Smartest's basic types.

Offsets

  • $object.red or $object.r: A Smartest8BitInteger object containing the red value for the colour.
  • $object.green or $object.g: A Smartest8BitInteger object containing the green value for the colour.
  • $object.blue or $object.b: A Smartest8BitInteger object containing the blue value for the colour.
  • $object.hex: A string containing the hex value for the colour, e.g. ff9900. Note the hex value is not preceded by a hash (#).
  • $object.rgb: A string containing the rgb value for the colour, e.g. 256,45,0.
  • $object.brightness: A Smartest8BitInteger object containing the calculated brightness value for the colour.
  • $object.brightness_int: An integer representing the calculated brightness value for the colour.
  • $object.text_white: A boolean indicating whether, if this colour were in the background, white text would be better used to write on it in order to be seen. Tends to be true for darker colours.
  • $object.text_black: A boolean indicating whether, if this colour were in the background, black text would be better used to write on it in order to be seen. Tends to be true for lighter colours.