projects > ntc js (name that color javascript)
ntc js (Name that Color JavaScript)
- Being a typical guy, I have no clue what the colors Lavender and Mauve look like. So I made this little app called Name that Color where you can create a color on the screen (or copy-paste CSS hex# color) and find out the name of the closest matching color.
- If you want to incorporate the same facility into your website or project, you can use the simple library that I created.
- You may directly link to or include my ntc.js file or you may download a copy and use it as you wish. You may also re-code the library to any language and platform of your choice.
Live Demo of ntc
Download ntc
- ntc js (Name that Color JavaScript) - 44kb (Just right-click and 'Save Target As' or similar.)
Credits
- Some code from Farbtastic by Steven Wittens was incorporated into this library.
- The Resene RGB Values List is copyrighted to Resene Paints Ltd, 2001.
- The color names in this list were found via Wikipedia, Crayola, and Color-Name Dictionaries.
License
- The ntc js library is released under the Creative Commons license.
- While I use code and algorithms from various sources, I always respect the code license and give credit where it's due. If you think that I am using your code/algorithm without the appropriate license, please let me know.
Usage
- Method a: Download ntc.js from the link above and copy it to your server.
- Method b: Or directly link to my hosted version.
- View the sample code below for more details.
Sample HTML Code
<script type="text/javascript" src="https://chir.ag/projects/ntc/ntc.js"></script>
<script type="text/javascript">
var n_match = ntc.name("#6195ED");
n_rgb = n_match[0]; // RGB value of closest match
n_name = n_match[1]; // Text string: Color name
n_exactmatch = n_match[2]; // True if exact color match
alert(n_match);
</script>
Documentation
- For help and documentation on how to use the ntc js (Name that Color JavaScript), view the sample code above. View the source-code of ntc.js for more information.
- Due to time constraints, I cannot write detailed documentation for ntc js. However, feel free to email me for further information, technical questions, ideas, improvements etc.
Disclaimer
- Developer: Chirag Mehta, 4 Sep. 2007
- This text, algorithm, and design is copyrighted to Chirag Mehta, 2007.
- For reproduction / copyright information contact me.