The transparency value of the color, scaled from 0 to 1
The blue value of the color, scaled from 0 to 1
Controls whether the ColourPicker.alpha slider is enabled
window = osrs.Ui.window({
title = 'Colour Picker',
collapsable = false,
resizable = false,
sizeMode = osrs.Ui.LayoutMode.MANUAL,
width = 370,
height = 350,
})
local pick4 = osrs.Ui.colourPicker({enableAlpha = true})
pick4.onValueChange = function(red, green, blue)
osrs.print("Red: " .. red .. " , Green: " .. green .. " , Blue: " .. blue .. " , Alpha: " .. alpha)
end
osrs.Ui.canvas:addChild(window)
window:addChild(pick4)
The green value of the color, scaled from 0 to 1
OptionalonThe function callback invoked when the element's value is changed.
window = osrs.Ui.window({
title = 'Colour Picker',
collapsable = false,
resizable = false,
sizeMode = osrs.Ui.LayoutMode.MANUAL,
width = 370,
height = 350,
})
local pick3 = osrs.Ui.colourPicker()
pick3.onValueChange = function(red, green, blue)
osrs.print("Red: " .. red .. " , Green: " .. green .. " , Blue: " .. blue)
end
osrs.Ui.canvas:addChild(window)
window:addChild(pick3)
The red value of the color, scaled from 0 to 1
Controls if the preview for the color displays a half opaque / half alpha-controlled transparency color if ColourPicker.enableAlpha enabled
window = osrs.Ui.window({
title = 'Colour Picker',
collapsable = false,
resizable = false,
sizeMode = osrs.Ui.LayoutMode.MANUAL,
width = 370,
height = 350,
})
local pick4 = osrs.Ui.colourPicker({enableAlpha = true, useHalfPreview = true})
pick4.onValueChange = function(red, green, blue)
osrs.print("Red: " .. red .. " , Green: " .. green .. " , Blue: " .. blue .. " , Alpha: " .. alpha)
end
osrs.Ui.canvas:addChild(window)
window:addChild(pick4)
Boolean indicating whether this UI element should draw itself.
-- Create new container
local newWindow = osrs.Ui.window({title = "Example Window"})
-- Create a button that is renderable, and one that is not
local button1 = osrs.Ui.textButton(
{
text = "Peek-a-Boo",
visible = false,
onClick = function()
osrs.print("BOO!")
end
}
)
local button2 = osrs.Ui.textButton(
{
text = "Render",
onClick = function()
button1.visible = not button1.visible
end
}
)
-- Add buttons to the container
newWindow:addChild(button1)
newWindow:addChild(button2)
-- Add container to the canvas
osrs.Ui.canvas:addChild(newWindow)
Creates a colour picker window for red, green, and blue.