omgovich / colord

👑 A tiny yet powerful tool for high-performance color manipulations and conversions
https://colord.omgovich.ru
MIT License
1.63k stars 48 forks source link

feat(colord): add `toBase10` #109

Open kyranet opened 11 months ago

kyranet commented 11 months ago

Fixes #104

I chose not to add src/colorModels/base10.ts (and therefore support numbers as input) because it would be impossible to properly determine whether a number is RGB or RGBA, so the solution I reached was to just add a method.

This addition would also prove very helpful for APIs that natively use (and support) base10 numbers, such as Discord.