binary

hex

unbinary

unhex

binary

Arguments
[val][val num-digits]
Docstring
Returns a string representing the binary value of an int, char or
byte. When converting an int to a string, it is possible to specify
the number of digits used.
Works only inside sketch functions?
No
Original Processing method
binary()
Example
(q/background 255)
(q/fill 0)
(q/text (q/binary 42) 10 10)
(q/text (q/binary 42 5) 10 30)
try example

hex

Arguments
[val][val num-digits]
Docstring
Converts a byte, char, int, or color to a String containing the
equivalent hexadecimal notation. For example color(0, 102, 153) will
convert to the String "FF006699". This function can help make your
geeky debugging sessions much happier. 
Works only inside sketch functions?
No
Original Processing method
hex()
Example
(q/background 255)
(q/fill 0)
(q/text (q/hex 42) 10 10)
(q/text (q/hex 42 5) 10 30)
try example

unbinary

Arguments
[str-val]
Docstring
Unpack a binary string to an integer. See binary for converting
integers to strings.
Works only inside sketch functions?
No
Original Processing method
unbinary()
Example
(q/background 255)
(q/fill 0)
(q/text (str (q/unbinary "0101010")) 10 10)
try example

unhex

Arguments
[hex-str]
Docstring
Converts a String representation of a hexadecimal number to its
equivalent integer value.
Works only inside sketch functions?
No
Original Processing method
hex()
Example
(q/background 255)
(q/fill 0)
(q/text (str (q/unhex "2A")) 10 10)
try example