doc: Merged and updated old docs for Number#toColorPart.

This commit is contained in:
tjcrowder 2009-09-10 16:32:36 +01:00
parent e6b6193124
commit a47d9e1c2f
1 changed files with 6 additions and 1 deletions

View File

@ -17,8 +17,13 @@ Object.extend(Number.prototype, (function() {
* Number#toColorPart() -> String
*
* Produces a 2-digit hexadecimal representation of the number
* (which is therefore assumed to be in the [0..255] range).
* (which is therefore assumed to be in the \[0..255\] range, inclusive).
* Useful for composing CSS color strings.
*
* ### Example
*
* 10.toColorPart()
* // -> "0a"
**/
function toColorPart() {
return this.toPaddedString(2, 16);