jfairbank / chroma

Ruby gem for color manipulation and palette generation
ISC License
232 stars 29 forks source link

Equivalent of tinyColor's toRgb #28

Open akshaysmurthy opened 5 years ago

akshaysmurthy commented 5 years ago

I know chroma has a to_rgb method, but it's actually a port of tinyColor's toRgbString.

I am interested in adding a method to this lib which will output a hash eg., {r: 255, g: 255, b: 255}.

This can be very useful to do some arithmetic on the r, g and b values individually.

Is this something that makes sense to be added to this lib?

akshaysmurthy commented 5 years ago

I just figured that Chroma::Color can return a Chroma::ColorModes::Rgb from which one could get an array. Feel free to close this issue if it doesn't make sense.