Copyright © tutorialspoint.com
This method produces a 2-digit hexadecimal representation of the number which is therefore assumed to be in the [0..255] range.
This function is useful for composing CSS color strings.
number.toColorPart(); |
<html> <head> <title>Prototype examples</title> <script type="text/javascript" src="/javascript/prototype.js"> </script> <script> function showResult(){ alert("(128).toColorPart() : " + (128).toColorPart() ); alert("(10).toColorPart() : " + (10).toColorPart() ); } </script> </head> <body> <p>Click the button to see the result.</p> <br /> <br /> <input type="button" value="Result" onclick="showResult();"/> </body> </html> |
To understand it in better way you can Try it yourself.
Copyright © tutorialspoint.com