== color-japanese

=== DESCRIPTION

color-japanese defines RGB value for Japanese color names.

Supported color names are:
* Japanese traditional colors
* JIS Z 8102 (Names of non-luminous object colours)


=== SYNOPSIS

require "rubygems"
require "color/rgb/jp"

# way to get sakura-iro.
# you can specify color name as kanji, hiragana, katakana and romaji (UTF-8).
puts Color::RGB::JP::Traditional::Sakurairo
puts Color::RGB::JP::Traditional["桜色"]
puts Color::RGB::JP::Traditional["さくらいろ"]
puts Color::RGB::JP::Traditional["サクライロ"]
puts Color::RGB::JP::Traditional["sakura-iro"]

# use other encoding.
puts Color::RGB::JP::Traditional[sjis_string, "Shift_JIS"]

# puts color names (UTF-8).
c = Color::RGB::JP::Traditional["桜色"] #=> #<Color::RGB::JP::NamedRGB:0xXXXXXXXX ...>
puts c #=> "sakura-iro (#fef4f4)"
puts c.name.kanji #=> "桜色"
puts c.name.hiragana #=> "さくらいろ"
puts c.name.katakana #=> "サクライロ"
puts c.name.romaji #=> "sakura-iro"
puts c.name.to_a #=> ["桜色", "さくらいろ", "サクライロ", "sakura-iro"]

# and Shift_JIS.
puts c.name.kanji("Shift_JIS")
puts c.name.hiragana("Shift_JIS")
puts c.name.katakana("Shift_JIS")
puts c.name.to_a("Shift_JIS")

# Color::RGB class provided by color-tools.
puts c.rgb #=> #<Color::RGB:0xXXXXXXXX>
puts c.rgb.html #=> "#fef4f4"
cmyk = c.rgb.to_cmyk
p %W(c m y k).map{|e| cmyk.__send__(e) } #=> [0.00379838523644751, 0.0430140715109573, 0.0430140715109573, 0.00012318339100346]


# Enumerable methods.
puts Color::RGB::JP::Traditional.grep{|e| e.name.romaji =~ /[sz]akura/i }.map{|e| e.name.romaji}

# puts all traditional color names.
Color::RGB::JP::Traditional.each do |c|
puts "%s: %s (%s)" % [c.rgb.html, c.name.kanji, c.name.hiragana]
end

# and JIS Z 8102.
Color::RGB::JP::JISZ8102.each do |c|
puts "%s: %s (%s)" % [c.rgb.html, c.name.kanji, c.name.hiragana]
end


=== COMMAND

color-japanese provies _jcolorc_ command.

For more details, please see jcolorc[link:files/bin/jcolorc.html] document.


=== LIST OF COLORS

example color pallets (generated by examples/color2html.rb).

* Color::RGB::JP::Traditional[link:examples/traditional.html]
* Color::RGB::JP::JISZ8102[link:examples/jisz8102.html]


=== REQUIREMENTS

* color-tools[http://ruby-pdf.rubyforge.org/color-tools/index.html]


=== INSTALL

[Unix]
sudo gem install -y color-japanese

[Windows]
gem install -y color-japanese


=== LICENSE

color-japanese is released under the MIT license.

Copyright (c) 2007 MIYAMUKO Katsuyuki.

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


=== OTHER STUFF

Author:: MIYAMUKO Katsuyuki <mailto:[email protected]>
Home URL:: http://color-japanese.rubyforge.org
Project URL:: http://rubyforge.org/projects/color-japanese