OSRS Plugin API
    Preparing search index...

    Class Colour4

    Represents a colour in RGBA format, with each colour channel in the range of [0-1].

    Index

    Constructors

    Properties

    a b g r

    Methods

    Constructors

    Properties

    a: number

    The alpha channel range [0-1]. 1 is fully opaque.

    -- Create a new Colour4
    local colour4 = osrs.Colour4.new(1,0,0,1)
    -- Print the alpha channel number
    osrs.print(tostring(colour4.a))
    -- Change the alpha channel number
    colour4.a = .5
    -- Print the new alpha channel number
    osrs.print(tostring(colour4.a))
    b: number

    The blue channel range [0-1].

    -- Create a new Colour4
    local colour4 = osrs.Colour4.new(1,0,0,1)
    -- Print the blue channel number
    osrs.print(tostring(colour4.b))
    -- Change the blue channel number
    colour4.b = 1
    -- Print the new blue channel number
    osrs.print(tostring(colour4.b))
    g: number

    The green channel range [0-1].

    -- Create a new Colour4
    local colour4 = osrs.Colour4.new(1,0,0,1)
    -- Print the green channel number
    osrs.print(tostring(colour4.g))
    -- Change the green channel number
    colour4.g = 1
    -- Print the new green channel number
    osrs.print(tostring(colour4.g))
    r: number

    The red channel range [0-1].

    -- Create a new Colour4
    local colour4 = osrs.Colour4.new(1,0,0,1)
    -- Print the red channel number
    osrs.print(tostring(colour4.r))
    -- Change the red channel number
    colour4.r = .5
    -- Print the new red channel number
    osrs.print(tostring(colour4.r))

    Methods

    • Instantiates a new Colour4.

      Parameters

      • Optionalr: number

        the red-channel value, range [0-1]

      • Optionalg: number

        the green-channel value, range [0-1]

      • Optionalb: number

        the blue-channel value, range [0-1]

      • Optionala: number

        the alpha-channel value, range [0-1].

      Returns Colour4

      The newly instantiated Colour4.

      -- Create a new Colour4
      local colour4 = osrs.Colour4.new(1,0,0,1)