TheDutchCoder / ColorConvert

A Sublime Text 2 plugin that converts CSS colors from hex to rgb and back
MIT License
55 stars 6 forks source link

Convert to rgb #15

Closed gnowland closed 10 years ago

gnowland commented 10 years ago

Is there any plan to allow converting to rgb()? If I'm supporting IE<8 I'd like to be able to just use rgb without alpha.

TheDutchCoder commented 10 years ago

Yeah I really should build an option for that, although I'm not sure what a good approach would be. Do you have a suggestion in mind?

I'd rather not to do something like: hex -> rgb -> rgba -> hsl -> hsla -> hex

As I want to keep the "chain" as short as possible.

gnowland commented 10 years ago

Honestly, I would build in that chain: hex -> rgb -> rgba -> hsl -> hsla -> hex

And allow the users to control which they prefer. Just add a JSON settings file that can be adjusted through the preferences menu, i.e.: Preferences > Package Settings > Color Convert > Settings - User

Just allow an option to "true/false" each individual color item. Honestly I don't use hsl or hsla so if I could adjust a settings file to make it ( hex -> rgb -> rgba ) I would be totally stoked.

I do agree that you should leave the "defaults" as you have them ( hex -> rgba -> hsla ) and that would satisfy most casual users... just have a setting for us "power" kids :)

You get that added and I'll paypal you a couple drinks!

TheDutchCoder commented 10 years ago

Excellent suggestion!

Thanks for taking the time to write it out, it would require me to read the settings, but I'm sure there's some default method for that ;-)

I really hope to pick up this development again, but those drinks sure sound like a good motivator ;-))

gnowland commented 10 years ago

I have never developed a package for Sublime Text before, but considering a number of packages do this I am assuming it's relatively straightforward... maybe a couple 'if' statements? idk

Anyway, thank you for your work, I do love this package!

TheDutchCoder commented 10 years ago

The latest release has the option to not output alpha channels, so this issue should be fixed!

Thanks for the feedback guys, it's appreciated!