OSRS Plugin API
    Preparing search index...

    Class ColourPicker

    Creates a colour picker window for red, green, and blue.

    Implements

    Index

    Properties

    alpha: number

    The transparency value of the color, scaled from 0 to 1

    blue: number

    The blue value of the color, scaled from 0 to 1

    enableAlpha: boolean

    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)
    green: number

    The green value of the color, scaled from 0 to 1

    onValueChange?: any

    The 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)
    red: number

    The red value of the color, scaled from 0 to 1

    useHalfPreview: boolean

    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)
    visible: boolean

    Boolean indicating whether this UI element should draw itself.

    true
    
    -- 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)