museun / readchat

a very simple alternative to 'streamchat'
The Unlicense
3 stars 0 forks source link

Idea: color mapping, and other user customization. #8

Open museun opened 3 years ago

museun commented 3 years ago

@halzy I was watching a vod and I noticed you mention its hard to read specific colors.

I could provide a mapping of twitch colors to user provided RGB.

or, with fg,bg pairs:

e.g.

blue = [127,0,255]
black = { fg = [255,255,255], bg = [0,0,0] }

The "standard" twitch color names: https://docs.rs/twitchchat/0.14.8/twitchchat/twitch/color/enum.TwitchColor.html

Another idea is to provide timestamp customization. Instead of it being hard-coded to HH:MM:SS (current TZ). let the user pick a timezone and string format.

Yet another idea: allow it to collapse the blank line between messages, if desired. This'll save 'precious' vertical spacing.

And a final idea: have a list of words that if a user says them, have it provide an "important" color for the name. Say a chatter says "Halzy" it could do white-on-red for their name as a highlight. (Words would likely be case-insensitive. but whole-word matching)

museun commented 3 years ago

And an afterthought: @mentions could also render with the proper colored name if we keep a MRU mapping of names:colors.

An after-afterthought: Have an optional setting to provide own our coloring of names, we could do a quick hash and use that to pick a name from an array of pre-determined colors, with modulus to wrap around. A hybrid approach could be that if they don't have a set color, pick from the 'colorful' array.

museun commented 3 years ago

I also thought of some better word-wrapping, a semi-smart approach could be applicable to wrap short things and let the terminal wrap "long" things.

I also could provide a 'color-test' mode, like the simulated chat, but just showing all of the colors so you can tweak them.

halzy commented 3 years ago

@museun Wow, so many ideas!

Dark colors on a dark background:

we may want to ensure that there is a minimum Lightness and Lighten the colors: https://docs.rs/palette/0.5.0/palette/trait.Shade.html#tymethod.lighten No need to use palette, RGB to HSL and back is straightforward.

An option to collapse the extra space:

This would be welcome! I'm using the same kitty instance for both and the font size is shared.

Time format:

It'd be a nice feature, but I'd set it back to the current value. (I like it)

Word highlighting:

This would be a great feature! Being able to specify a FG and BG color for words would be fantastic. This would be great even for @mentions because overriding the BG color would help make it more obvious. Could even use the specified color and 'adjust' it to be brighter / darker.

Word wrapping:

The current wrapping saves space but makes it hard to parse. I like your suggestion.