BIS fnc HEXtoRGB: Difference between revisions
Lou Montana (talk | contribs) m (Text replacement - "{{Function " to "{{RV|type=function ") |
Lou Montana (talk | contribs) m (Some wiki formatting) |
||
| (19 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
{{RV|type=function | {{RV|type=function | ||
| arma3 | |game1= arma3 | ||
|version1= 1.00 | |||
| | |gr1= Math | ||
| | |descr= Convert {{Color|red|R}}{{Color|green|G}}{{Color|blue|B}}{{Color|grey|A}} hexcode color into RGBA array format. | ||
| | |s1= [hexString] call [[BIS_fnc_HEXtoRGB]] | ||
| | |p1= hexString: [[String]] - string representing '''4 bytes''' of HEX color | ||
| | |r1= [[Array]] format [[Color|Color (RGBA)]] - array of '''4''' numbers in range 0..1 | ||
| [ | |x1= <sqf>["025D00FF"] call BIS_fnc_HEXtoRGB; // [1, 0.843138, 0, 1]</sqf> | ||
|x2= Usually HEX code is represented as 3 bytes without alpha, so you can add it yourself: | |||
|x2= Usually HEX code is represented as 3 | <sqf> | ||
_hexstring = "025D00"; | |||
[_hexString + "FF"] call BIS_fnc_HEXtoRGB; // add alpha 4th byte | |||
</sqf> | |||
| [[Color|Color (RGBA)]] | |seealso= [[Color|Color (RGBA)]] [[BIS_fnc_colorConfigToRGBA]] [[BIS_fnc_colorRGBAtoHTML]] [[BIS_fnc_colorRGBtoHTML]] [[BIS_fnc_colorRGBAtoTexture]] | ||
}} | }} | ||
Latest revision as of 12:27, 22 November 2025
Description
Syntax
- Syntax:
- [hexString] call BIS_fnc_HEXtoRGB
- Parameters:
- hexString: String - string representing 4 bytes of HEX color
- Return Value:
- Array format Color (RGBA) - array of 4 numbers in range 0..1
Examples
- Example 1:
- Example 2:
- Usually HEX code is represented as 3 bytes without alpha, so you can add it yourself:
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