ColorTools
ColorTools copied to clipboard
Colors change when they are converted using Html2Clr.
Expected behavior
When converting #f43f5e rose-500
using Html2Clr
, I expect the color rose-500 to have the value of #f43f5e
.
Actual behavior
The color does not get the value #f43f5e
. it instead gets the value #EE254C
,
Context
I discovered this issue when trying to convert a list of Tailwind 2 colors: https://github.com/GeneaLabs/tailwind-mac-colors/issues/2
The problem is that colorWithCalibratedRed:green:blue:alpha:
should be used:
https://developer.apple.com/documentation/appkit/nscolor/1526323-colorwithcalibratedred
Instead of colorWithRed:green:blue:alpha:
(probably in NSColor+Hexadecimal.m)
I created a tool based on the Script Editor that supports multiple input formats: https://github.com/adrium/any2clr