src code

instance method Number#toColorPart

Number#toColorPart() → String

Produces a 2-digit hexadecimal representation of the number (which is therefore assumed to be in the [0..255] range, inclusive). Useful for composing CSS color strings.

Example
10.toColorPart()
// -> "0a"