Convert string to color hash
29 Mar 2015So it happens that sometimes you need to convert string to color hash. I think that
Digest::MD5
class is easiest way for this. For this you need call hexdigest method
with necessary string.
And if you will create rgb color you need convert hex to decimal with to_i(16)
method.