BIS fnc HEXtoRGB: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(Page creation)
 
m (Text replacement - "Numbers" to "Numbers")
 
(27 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Function|Comments=
{{RV|type=function
____________________________________________________________________________________________


| arma3 |Game name=
|game1= arma3
|version1= 1.00


|1.00|Game version=
|gr1= Math
____________________________________________________________________________________________


| Convert hexcodes into rgb arrays. |Description=
|descr= Convert hexcode color into RGBA array format.
____________________________________________________________________________________________


| [hexArray] call [[BIS_fnc_HEXtoRGB]] |Syntax=
|s1= [hexString] call [[BIS_fnc_HEXtoRGB]]


|p1= hexArray: [[Array]] of [[Number|Numbers]] - array of '''8''' hexadecimal numbers. Note that ''hexArray'' '''is inside another array''' ({{Inline code|[ hexArray ]}}) |Parameter 1=
|p1= hexString: [[String]] - string representing '''4 octets''' of HEX color


| [[Array]] of [[Number|Numbers]] - array of '''4''' numbers in range 0..1 |Return value=
|r1= [[Array]] of [[Number]]s - array of '''4''' numbers in range 0..1
____________________________________________________________________________________________


|x1= <code><nowiki>[</nowiki>[[toArray]] "025D00FF"] [[call]] [[BIS_fnc_HEXtoRGB]];</code> |Example 1=
|x1= <sqf>["025D00FF"] call BIS_fnc_HEXtoRGB; // [1,0.843138,0,1]</sqf>
____________________________________________________________________________________________
|x2= Usually HEX code is represented as 3 octet without alpha, so you can add it yourself:
<sqf>[_hexString + "FF"] call BIS_fnc_HEXtoRGB; // Add 4th octet to get alpha</sqf>


| [[Color]], [[BIS_fnc_colorConfigToRGBA]], [[BIS_fnc_colorRGBAtoHTML]], [[BIS_fnc_colorRGBtoHTML]], [[BIS_fnc_colorRGBAtoTexture]] |See also=
|seealso= [[Color|Color (RGBA)]] [[BIS_fnc_colorConfigToRGBA]] [[BIS_fnc_colorRGBAtoHTML]] [[BIS_fnc_colorRGBtoHTML]] [[BIS_fnc_colorRGBAtoTexture]]
}}
}}
<h3 style="display:none">Notes</h3>
<dl class="command_description">
<!-- Note Section BEGIN -->
<!-- Note Section END -->
</dl>
<h3 style="display:none">Bottom Section</h3>
[[Category:Functions|{{uc:colorRGBAtoHTML}}]]
[[Category:Function Group: Misc|{{uc:colorRGBAtoHTML}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:colorRGBAtoHTML}}]]

Latest revision as of 23:38, 12 July 2022

Hover & click on the images for description

Description

Description:
Convert hexcode color into RGBA array format.
Execution:
call
Groups:
Math

Syntax

Syntax:
[hexString] call BIS_fnc_HEXtoRGB
Parameters:
hexString: String - string representing 4 octets of HEX color
Return Value:
Array of Numbers - array of 4 numbers in range 0..1

Examples

Example 1:
["025D00FF"] call BIS_fnc_HEXtoRGB; // [1,0.843138,0,1]
Example 2:
Usually HEX code is represented as 3 octet without alpha, so you can add it yourself:
[_hexString + "FF"] call BIS_fnc_HEXtoRGB; // Add 4th octet to get alpha

Additional Information

See also:
Color (RGBA) BIS_fnc_colorConfigToRGBA BIS_fnc_colorRGBAtoHTML BIS_fnc_colorRGBtoHTML BIS_fnc_colorRGBAtoTexture

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note