This will be implemented as render methods (and some style-specific parameters) common to all colored text-based render styles, defined by the [Colored]TextImage (not yet sure if ColoredTextImage will be a thing) class.
Progress:
[ ] Render methods selection
[ ] Support detection
[ ] Integration into existing text-based render styles
[ ] Style-spcific parameter
[ ] Style-spcific format spec field
[ ] CLI integration
[ ] TUI integration
*
Initial Idea
NB: These is mostly a raw dump of my thought process at the time I conceived the idea with updates once in a while, so might not be "neat".
[Colored]TextImage:
auto, direct, fbterm_256, xterm_256, ansi and no_color render methods for all text-based styles.
Determine and store the method equivalent to auto as _AUTO_METHOD
The first to be supported in order of quality
256 colors have a slightly different escape sequence that uses a pallete index rather than rgb values.
is_supported(): if any(_is_supported(method) for method in _render_methods)
... [See Keep Notes]
Style Params:
grey: bool = False -> Greyscale (only applies to methods other than none)
threshold_8color: int = 128 -> Any band of a pixel with a value less than the given value is taken to be 0. Otherwise, 1.
For text-based styles, On Kitty, cell BG colors that are equal to the default BG color take the form of the background (I.e might be translucent or blended with a background image).
This is overcome in the RGB method by slightly manipulating the pixel color (done in #54) but can still occur with 265color or 8color method, as fixing it in these modes will require modifying either the pallete entries or the default BG color, which is generally not desired behavior.
Requires #62
This will be implemented as render methods (and some style-specific parameters) common to all colored text-based render styles, defined by the
[Colored]TextImage
(not yet sure ifColoredTextImage
will be a thing) class.Progress:
[ ] Render methods selection
[ ] Support detection
[ ] Integration into existing text-based render styles
[ ] Style-spcific parameter
[ ] Style-spcific format spec field
[ ] CLI integration
[ ] TUI integration
Initial Idea
NB: These is mostly a raw dump of my thought process at the time I conceived the idea with updates once in a while, so might not be "neat".
[Colored]TextImage
:auto, direct, fbterm_256, xterm_256, ansi and no_color render methods for all text-based styles.
_AUTO_METHOD
is_supported(): if any(_is_supported(method) for method in _render_methods)
... [See Keep Notes]
Style Params:
Requires updating
_get_render_data()
:-1
because the color after black should be index 0round(x * 5 / 255)
r * 36 + g * 6 + b
16 + x
Known Issues:
For text-based styles, On Kitty, cell BG colors that are equal to the default BG color take the form of the background (I.e might be translucent or blended with a background image).
This is overcome in the RGB method by slightly manipulating the pixel color (done in #54) but can still occur with 265color or 8color method, as fixing it in these modes will require modifying either the pallete entries or the default BG color, which is generally not desired behavior.
Any suggestions are always welcome. 😃