ta1m1kam / color_space_converter

This is gem for transforming the color space.

Home Page:https://rubygems.org/gems/color_space_converter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

License: MIT Build Status Coverage Status Gem Version

ColorSpaceConverter

Welcome to ColorSpaceConverter gem! It is a gem for easy conversion of color space such as rgb, xyz, lab. This gem allows you to take into account the brightness of your display (if your display's gamut setting is sRGB).

Corresponding color space

  • rgb(hex)
  • rgb
  • xyz
  • lab

Installation

Add this line to your application's Gemfile:

gem 'color_space_converter'

And then execute:

$ bundle

Or install it yourself as:

$ gem install color_space_converter

Usage

Instantiation

require 'color_space_converter'

obj = ColorSpaceConverter.new

# Otherwise
# ColorSpaceConverter.new(color_space, element1(ex: r), element2(ex: g), element3(ex: b)) 
obj = ColorSpaceConverter.new('rgb', 128, 128, 128) 

Calculation

# to rgb
obj.calc_rgb

# to xyz
obj.calc_xyz

# to lab
obj.calc_lab

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/TaigaMikami/color_space_converter. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the ColorSpaceConverter project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

Author

TaigaMikami

TODO

Correspond to the following color space.

  • RGB
  • XYZ
  • LAB
  • HSV
  • PCCS
  • NCS

About

This is gem for transforming the color space.

https://rubygems.org/gems/color_space_converter

License:MIT License


Languages

Language:Ruby 99.1%Language:Shell 0.9%