ntc

Port of ntc.js by Chirag Mehta


License
CC-BY-2.5
Install
gem install ntc -v 0.0.1

Documentation

Information

Ntc is a Ruby port of the javascript library ntc.js. Ntc will give you the name of the closest defined color from Resene RGB Values list, Wikipedia, Crayola, and Color-Name Dictionaries.

Basic Usage

Ntc can be used as

require "./ntc"

color = Ntc.new("#000000")
# #<Ntc:0x00000001a63758 @color="#000000">

color.name
# ["#000000", "Black", true]

color_rgb = color.name[0] # RGB value of the closest match
# "#000000"
color_name = color.name[1] # Name of closest match
# "Black"
color_exactmatch = color.name[2] # True if exact color match
# true

License