ColorTools icon indicating copy to clipboard operation
ColorTools copied to clipboard

Colors change when they are converted using Html2Clr.

Open cor opened this issue 3 years ago • 1 comments

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

cor avatar Mar 01 '21 15:03 cor

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

adrium avatar Dec 19 '22 21:12 adrium