facelessuser / ColorHelper

Sublime plugin that provides helpful color previews and tooltips
https://facelessuser.github.io/ColorHelper/
MIT License
254 stars 30 forks source link

Add color rule for INI syntax #264

Closed gosxrgxx closed 3 months ago

gosxrgxx commented 3 months ago

Support colors for .ini files

facelessuser commented 3 months ago

Thanks for the pull, I'll try to evaluate it sometime soon.

facelessuser commented 3 months ago

@gosxrgxx, I think you want a pattern more like:

(?i)(?:\\b(?<![-#&$])(?:color\\((?!\\s*-)|(?:hsla?|(?:ok)?(?:lch|lab)|hwb|rgba?)\\()|\\b(?<![-#&$])[\\w]{3,}(?![(-])\\b|(?<![&])\\#)
facelessuser commented 3 months ago

I think that is the default pattern though, so you can just remove that pattern entry entirely.

gosxrgxx commented 3 months ago

To exclude color names (green, red, etc.). Perhaps you can suggest a more suitable solution.

facelessuser commented 3 months ago

When I'm adding such rules, I'm keeping them generic as everyone may want different things. INI files don't have innate color requirements.

facelessuser commented 3 months ago

If a specific file type has a specific spec in relation to colors, that is generally when we are more selective.

gosxrgxx commented 3 months ago

Ok. In that case, should I remove the line with the regular expression, or will you do it?

facelessuser commented 3 months ago

Ideally, you could make the change in this PR.

facelessuser commented 3 months ago

@gir-bot lgtm