[][src]Static p5_sys::global::hex

pub static hex: HexInternalType

Converts a number to a string in its equivalent hexadecimal notation. If a second parameter is passed, it is used to set the number of characters to generate in the hexadecimal notation. When an array is passed in, an array of strings in hexadecimal notation of the same length is returned.

Examples

print(hex(255)); // "000000FF"
print(hex(255, 6)); // "0000FF"
print(hex([0, 127, 255], 6)); // [ "000000", "00007F", "0000FF" ]
print(Infinity); // "FFFFFFFF"
print(-Infinity); // "00000000"

Overloads

n value to parse

digits?


ns array of values to parse

digits?