HexToRGBA: Difference between revisions

From Onset Developer Wiki
(Created page with "{{FuncSyntax|HexToRGBA(HexColor) }}")
 
No edit summary
 
(13 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{FuncSyntax|HexToRGBA(HexColor)
{{Info|Function|Server & Client|1.0}}
}}
 
{{FuncDescription|Converts an integer color value to the RGB format.}}
 
{{FuncSyntax|HexToRGBA(HexColor)}}
 
{{FuncParameters}}
{{FuncParam|HexColor|Color in integer format}}
 
{{FuncReturnValue|R, G, B, A values between 0 and 255}}
 
== Example ==
<syntaxhighlight lang="Lua">
function convertColor(hex)
    return r, g, b, a = HexToRGBA(hex)
end
</syntaxhighlight>
 
{{RelatedFunctions}}
* [[RGB]]
* [[RGBA]]
* [[HexToRGBAFloat]]

Latest revision as of 17:36, 16 July 2020

HexToRGBA

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

Description

Converts an integer color value to the RGB format.

Syntax

HexToRGBA(HexColor)

Parameters

  • HexColor
    Color in integer format

Return Value

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

Example

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

See also