I know there is a gem called Color. I installed it.
But for the life of me, I can't figure out how to use the thing.
I just want to convert a color name into its RGB values, if possible without copying the whole color table into my code.
I want to be able to convert something like red
or Navy
into three numeric values.
require 'color/css'
red_code = Color::CSS["red"].html
#=> "#ff0000"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With