The alpha channel range [0-255]. 255 is fully opaque.
The blue channel range [0-255].
The green channel range [0-255].
The red channel range [0-255].
Sets the Colour to the submitted values, and returns a reference to the Colour object.
red-channel.
green-channel.
blue-channel.
alpha-channel.
Reference to the Colour object.
-- Create a new Colour
local colour = osrs.Colour.new(255,0,0,255)
-- Print the red, blue, green, and alpha channels
osrs.print("Color R: " .. tostring(colour.r) .. " G: " .. tostring(colour.g)
.. " B: " .. tostring(colour.b) .. " A: " .. tostring(colour.a))
-- Set the colour to something new
colour:set(100, 255, 100, 50)
-- Print the new red, blue, green, and alpha channels
osrs.print("Color R: " .. tostring(colour.r) .. " G: " .. tostring(colour.g)
.. " B: " .. tostring(colour.b) .. " A: " .. tostring(colour.a))
StaticnewInstantiates a new Colour.
Optionalr: numberthe red-channel value, range [0-255]
Optionalg: numberthe green-channel value, range [0-255]
Optionalb: numberthe blue-channel value, range [0-255]
Optionala: numberthe alpha-channel value, range [0-255].
The newly instantiated Colour.
Represents a colour in RGBA format, with each colour channel in the range of [0-255].