HexToRGBA: Difference between revisions

From Onset Developer Wiki
No edit summary
Kuzkay (talk | contribs)
No edit summary
Line 1: Line 1:
{{Info|Function|Server & Client|1.0}}
{{Info|Function|Server & Client|1.0}}


{{FuncDescription|__EDIT_ME__}}
{{FuncDescription|Converts Hex color value into RGB format}}


{{FuncSyntax|HexToRGBA(HexColor)}}
{{FuncSyntax|HexToRGBA(HexColor)}}


{{FuncParameters}}
{{FuncParameters}}
{{FuncParam|HexColor|__EDIT_ME__}}
{{FuncParam|HexColor|Color in Hex format}}


{{FuncReturnValue|__EDIT_ME__}}
{{FuncReturnValue|R, G, B, A values between 0 and 255}}


== Example ==
== Example ==
__EDIT_ME__
<syntaxhighlight lang="Lua">
function convertColor(hex)
    return r, g, b, a = HexToRGBA(hex)
end
AddCommand("objtest", cmd_objtest)
</syntaxhighlight>


{{RelatedFunctions}}
{{RelatedFunctions}}
__EDIT_ME__
__EDIT_ME__

Revision as of 18:15, 13 November 2019

HexToRGBA

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

Description

Converts Hex color value into RGB format

Syntax

HexToRGBA(HexColor)

Parameters

  • HexColor
    Color in Hex format

Return Value

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

Example

function convertColor(hex)
    return r, g, b, a = HexToRGBA(hex)
end
AddCommand("objtest", cmd_objtest)

See also

__EDIT_ME__