There are a bunch of color formats, and it doesn't make sense to build all of them into the library. If we had an extension API where someone could register something like:
Then the lib could loop through extensions and send tinycolor(input) into the toRgb method if shouldHandleInput is true (which would be true for something like 0xaabbcc in a "number" extension. Then when tinycolor(0xaabbcc).toString("number") is called it would defer to the extension's implementation.
Originally from #98.
There are a bunch of color formats, and it doesn't make sense to build all of them into the library. If we had an extension API where someone could register something like:
Then the lib could loop through extensions and send tinycolor(input) into the toRgb method if shouldHandleInput is true (which would be true for something like
0xaabbcc
in a "number" extension. Then when tinycolor(0xaabbcc).toString("number") is called it would defer to the extension's implementation.So proposed API is something like: