Open benrom opened 8 years ago
Also fails with shorter hex values like #ccc
(valid in html, equals to #cccccc
):
iex> ColorUtils.hex_to_rgb("#ccc")
** (FunctionClauseError) no function clause matching in ColorUtils.hex_to_rgb/1
lib/color_utils.ex:59: ColorUtils.hex_to_rgb("ccc")
@benrom please check if #5 works for you.
Success!
iex(1)> ColorUtils.hex_to_rgb("#C8C8C8")
%ColorUtils.RGB{blue: 200.0, green: 200.0, red: 200.0}
iex(2)> ColorUtils.hex_to_rgb("#c8c8c8")
%ColorUtils.RGB{blue: 200.0, green: 200.0, red: 200.0}
iex(3)> ColorUtils.hex_to_rgb("#ccc")
%ColorUtils.RGB{blue: 204.0, green: 204.0, red: 204.0}
I forgot to close this issue.. Would it be possible to get a new hex release soon that includes all the latest fixes?
Actually that PR has not been merged yet... reopening