BIS fnc HEXtoRGB: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "Color" to "Color (RGBA)") |
Lou Montana (talk | contribs) m (Text replacement - "_{10,} " to "") |
||
Line 1: | Line 1: | ||
{{Function|Comments= | {{Function|Comments= | ||
| arma3 |Game name= | | arma3 |Game name= | ||
Line 7: | Line 6: | ||
|gr1= Math |GROUP1= | |gr1= Math |GROUP1= | ||
| Convert hexcode color into RGBA array format. |Description= | | Convert hexcode color into RGBA array format. |Description= | ||
| [hexString] call [[BIS_fnc_HEXtoRGB]] |Syntax= | | [hexString] call [[BIS_fnc_HEXtoRGB]] |Syntax= | ||
Line 17: | Line 14: | ||
| [[Array]] of [[Number|Numbers]] - array of '''4''' numbers in range 0..1 |Return value= | | [[Array]] of [[Number|Numbers]] - array of '''4''' numbers in range 0..1 |Return value= | ||
|x1= <code>["025D00FF"] [[call]] [[BIS_fnc_HEXtoRGB]]; // [1,0.843138,0,1]</code> |Example 1= | |x1= <code>["025D00FF"] [[call]] [[BIS_fnc_HEXtoRGB]]; // [1,0.843138,0,1]</code> |Example 1= | ||
|x2= Usually HEX code is represented as 3 octet without alpha, so you can add it yourself:<code>[_hexString + "FF"] [[call]] [[BIS_fnc_HEXtoRGB]]; // Add 4th octet to get alpha</code> |Example 2= | |x2= Usually HEX code is represented as 3 octet without alpha, so you can add it yourself:<code>[_hexString + "FF"] [[call]] [[BIS_fnc_HEXtoRGB]]; // Add 4th octet to get alpha</code> |Example 2= | ||
| [[Color|Color (RGBA)]], [[BIS_fnc_colorConfigToRGBA]], [[BIS_fnc_colorRGBAtoHTML]], [[BIS_fnc_colorRGBtoHTML]], [[BIS_fnc_colorRGBAtoTexture]] |See also= | | [[Color|Color (RGBA)]], [[BIS_fnc_colorConfigToRGBA]], [[BIS_fnc_colorRGBAtoHTML]], [[BIS_fnc_colorRGBtoHTML]], [[BIS_fnc_colorRGBAtoTexture]] |See also= |
Revision as of 21:56, 16 January 2021
Description
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_colorConfigToRGBABIS_fnc_colorRGBAtoHTMLBIS_fnc_colorRGBtoHTMLBIS_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