HexToRGBAFloat: Difference between revisions
From Onset Developer Wiki
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
{{Info|Function|Server & Client|1.0}} | {{Info|Function|Server & Client|1.0}} | ||
{{FuncDescription|Converts Hex color value into RGBA float}} | {{FuncDescription|Converts Hex color value into RGBA float. Useful for FLinearColor.}} | ||
{{FuncSyntax|HexToRGBAFloat(HexColor)}} | {{FuncSyntax|HexToRGBAFloat(HexColor)}} | ||
Line 8: | Line 8: | ||
{{FuncParam|HexColor|Hex color in float format.}} | {{FuncParam|HexColor|Hex color in float format.}} | ||
{{FuncReturnValue|R, G, B, A values between 0 and | {{FuncReturnValue|R, G, B, A values between 0.0 and 1.0}} | ||
== Example == | == Example == | ||
<syntaxhighlight lang="Lua"> | <syntaxhighlight lang="Lua"> | ||
function | function convertToFLinearColor(hex) | ||
local r, g, b, a = HexToRGBAFloat(hex) | |||
return FLinearColor(r, g, b, a) | |||
end | end | ||
</syntaxhighlight> | </syntaxhighlight> |
Latest revision as of 14:21, 23 November 2019
Description
Converts Hex color value into RGBA float. Useful for FLinearColor.
Syntax
HexToRGBAFloat(HexColor)
Parameters
- HexColor
Hex color in float format.
Return Value
- R, G, B, A values between 0.0 and 1.0
Example
function convertToFLinearColor(hex)
local r, g, b, a = HexToRGBAFloat(hex)
return FLinearColor(r, g, b, a)
end