Utils > funcs

sample

Returns a random element from an array, or null if empty.

dist

Euclidean distance between two points.

toHex

Converts a hex color number (e.g. 0xff0000) to a hex string (e.g. '#ff0000').

adjustColor

Adds amount to each R, G, B channel of a hex color number. Clamps to 0-255. Pass a negative amount to darken.

toColumns

Splits a flat array into nested arrays of the given column count for rexUI grid layout.




© Gamesanova 2026