BIS fnc HEXtoRGB: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Fix categories (HEXtoRGB sorting))
(overhaul due to outdated data)
Line 7: Line 7:
____________________________________________________________________________________________
____________________________________________________________________________________________


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


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


|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  |Parameter 1=


| [[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><nowiki>[</nowiki>[[toArray]] "025D00FF"] [[call]] [[BIS_fnc_HEXtoRGB]];</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=
____________________________________________________________________________________________
____________________________________________________________________________________________



Revision as of 13:58, 22 February 2019

Hover & click on the images for description

Description

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

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:
ColorBIS_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

Notes

Bottom Section