HexToRGBAFloat: Difference between revisions

From Onset Developer Wiki
(Created page with "{{Info|Function|Server & Client|1.0}} {{FuncDescription|Converts Hex color value into RGBA float}} {{FuncSyntax|HexToRGBAFloat(HexColor)}} {{FuncParameters}} {{FuncParam|He...")
 
No edit summary
Line 13: Line 13:
<syntaxhighlight lang="Lua">
<syntaxhighlight lang="Lua">
function convertColor(hex)
function convertColor(hex)
     return r, g, b, a = HexToRGBAFloat(HexColor)
     return r, g, b, a = HexToRGBAFloat(hex)
end
end
</syntaxhighlight>
</syntaxhighlight>

Revision as of 15:24, 16 November 2019

HexToRGBAFloat

Type: Function
Context: Server & Client
Introduced: v1.0

Description

Converts Hex color value into RGBA float

Syntax

HexToRGBAFloat(HexColor)

Parameters

  • HexColor
    Hex color in float format.

Return Value

  • R, G, B, A values between 0 and 255

Example

function convertColor(hex)
    return r, g, b, a = HexToRGBAFloat(hex)
end

See also