stash icon indicating copy to clipboard operation
stash copied to clipboard

[Feature] Tag colors

Open xx790 opened this issue 2 years ago • 4 comments

Is your feature request related to a problem? Please describe.

I have a lot of tags. Some tags fall under common categories. I'd like to make tags of the same nature to be more like each other and more distinguishable from other tags visually.

Describe the solution you'd like

Typical solution on booru sites: tags of certain kinds are distinguished by color. stash doesn't have namespaced tags but it has tags graph that can potentially be used. Albeit multiple parents can make it complicated.

There are multiple ways this can be implemented:

  • Each tag has an extra field for background color. No inheritance, more manual work but I can live with it;
  • Common color for children tags is set in the parent tag (meta tag for my purposes). Not sure how to resolve conflicts;
  • Color can be inherited from parent tag(s). Same disadvantage as with the previous plus inability to have parent meta tags to be different from children;
  • Add semantic markup so I could solve coloring issue in CSS. Specifically, add a data property to tag cards that would list tag parents. Like data-parents="tag1 tag2". Very DIY, mentioning it here in case it is cheap to add.

Color range: Hue slider might be preferable compared to full RGB range. It might be easier to ensure consistent looks and good contrast in both dark and light theme. (Relevant: HSL color model in CSS)

Sort by color: Would be nice to have. First tags with specified colors, then the rest.

xx790 avatar Nov 27 '22 20:11 xx790

People are already doing this with userscripts, no?

I think a built-in feature like this should be considered with caution. To mitigate confusion and improve consistency throughout the UI I think the UI needs to adhere to a strict hierarchal color palette for elements (red for destructive elements, bright blue for primary elements, blue/grey for secondary elements, etc). Therefore, IMO a custom tag colors feature should be implemented in a way that avoids color collisions with the core UI color palette.

echo6ix avatar Nov 27 '22 21:11 echo6ix

I mean, I can approximate it with a userscript to some extent.

  • I will have to put keywords in the tag description, since parent tags are hidden from HTML once there are more than one. And this won't work in places where only name is shown (especially tag badges);
  • Or I will have to maintain colors for all tags in the userscript, which is significantly less convenient.

And I have to check whether tampermonkey is happy to work on localhost:port urls. No luck on mobile (maybe if I use a separate browser specifically for stash).

I just think it is not just me and it can be useful for many people.

When only Hue is specified, it can be toned down (less saturation and lightness closer to regular background) so it won't collide with UI highlights.

xx790 avatar Nov 27 '22 22:11 xx790

I've already been running a userscript to do this in Stash. It uses code prefixes in the tag name to know which color to use and also hides the prefix in most views. I was already using those leading codes to enforce a custom sort order for my tags already so it was the easiest way to do it. Ping me in Discord (same username) and I can send you a copy. Would be nice to get a native solution though since it's a little hacky.

Linking the issue "Sort_Name for Tags" #3108 since it's related to the current solution for color-coding.

AdultSun avatar Nov 27 '22 23:11 AdultSun

@AdultSun So you introduced the notion of tag namespaces into stash essentially. Interesting.

Now I will be contemplating whether I should embrace it for the time being.

xx790 avatar Nov 28 '22 00:11 xx790