Project

color_math

0.0
No commit activity in last 3 years
No release in over 3 years
Gem to convert between HSL color to RGB and vice versa, RGB color to hex color code and vice versa.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

color math

Ruby Gem for RGB to HSL and RGB to HSV color model conversion algorithms in Ruby

Installation

gem install color_math

Usage

require 'rubygems'

require 'color_math'

cl = ColorMath.new 255, 255, 255

cl.to_hex # returns hex notation of r g b (255, 255, 255)

cl.to_hsl # returns hsl notation of r g b (255, 255, 255)

also can be initialized from hsl or hex with

cl = ColorMath.from_hsl(360, 100, 100) #where 360 is hue, 100 is saturation and 100 is luminous or brightness

cl = ColorMath.from_hex("#FFFFFF")