Convert Hex color to RGBA
def hex_to_rgba(input, alpha=1) components = (input.match /#?([0-9A-F]{2})/ )[1..3] components.map!{ |x| x + x } if input.size == 4 "rgba(#{components.collect(&:hex).join(',')},#{alpha})" end