sublimehq / sublime_text

Issue tracker for Sublime Text
https://www.sublimetext.com
803 stars 39 forks source link

Add more flexible options to color file type icons based on state #6351

Open Monokai opened 5 months ago

Monokai commented 5 months ago

Problem description

I'd like to define different state colors for file type icons in my theme. Sublime Text works with pre-rendered images. You can use layer.tint to add a color overlay and you can use layer.opacity to fade an icon.

Consider this use case. In the sidebar some files are ignored and I want to de-emphasize its colors. In my theme I'm giving the sidebar_label class a dimmed color so that works fine. I also would like to dim the icon image, but not via opacity. I'd like to have a monochrome file icon when the file is ignored, so basically a different solid color than a normal vibrant color.

With the current properties I can't achieve this. Setting a tint on a pre-rendered colored icon doesn't work, it only makes it darker. Setting opacity also doesn't work.

What would work is pre-rendering icons as pure white icons and use the layer.tint property to color them. But then you can't use different colors for different icons anymore.

Preferred solution

Keep only one pure white file icons set, use an optional tint color from a newly defined property in the file_type_x.tmPreferences file.

Alternatives

Additional Information

No response

deathaxe commented 5 months ago

The preferred solution

  1. wouldn't work well for multi-color icons.
  2. would cause theme specific settings to be out-sourced to dozens of *.tmPreferences files, which are unrelated to theming. How should that work with packages like File Icons or A File Icons which ship their own file type settings, but are not related with any theme?

    Note, tmPreferences are always applied, regardless which theme is selected.

A layer.saturation property would maybe solve the specific problem better.

Monokai commented 5 months ago

@deathaxe

You're right, I hadn't considered multi-color at all. And I guess tmPreferences isn't the right place. It's hard for me sometimes to reason about what goes where and which files do what when. Anyway, my proposed solutions won't suffice.

A saturation filter would work in my specific case (albeit I'd rather define a specific desatured color), but what about when you want to display a different icon altogether (maybe an outlined icon variant instead of a solid filled icon for ignored files?).

Maybe just a simple filename override in the theme would work?