TermBuf::Style
Stability: stable — changes only in a major release.
Everything about a cell other than the character in it.
Styles are values, so they compare and hash by content. StyleTable
interns them, which is what lets a Cell carry a four byte id instead of
this whole struct.
Constants
The style a freshly cleared terminal is in.
A blend that keeps the colour already behind each cell and takes everything else from the style being written — a label across a progress bar, without the caller working out where the bar's colours change. A background named in the written style is ignored.
The position is ignored: this blend answers the same way wherever the cell is, which is why the two arguments it does use are named and the rest are not.
A blend laying the written style over what is already there, field by
field, the way a view lays its own style under a write. See #merge.
The position is ignored, as it is for KEEP_BACKGROUND.
Constructors
A style from its parts. DEFAULT and the builders on it — #bold,
#fg, #bg, #underlined — are the usual way to reach one.
Class methods
Wraps a two argument block as a Blend, for the blends that answer from
the two styles alone.
dim = TermBuf::Style.blend { |under, over| under.merge(over).faint }
The position the Blend signature carries is dropped rather than named,
since a block written this way has nowhere to receive it.
Instance methods
Returns a copy with the named fields replaced.
Whether the cell paints anything other than its background. A cell that does not is interchangeable with a blank of the same background, which is what lets the painter reach for an erase instead of writing spaces.
OSC 8 hyperlink id, or zero for no link. Buffer#link and
Terminal#link intern a URI and hand back the id; #linked puts it
here. See LinkTable.
A copy of this style with everything other sets taking over. A field other leaves at its default is kept from here.
What a surface carrying a base style needs: a panel says its background once, and a write inside it names only the colour and the attributes it cares about. Colours, the underline style, and the link merge that way.
Attributes are the exception. They are flags rather than a choice of one,
so they combine: a bold write inside a faint panel is both, and there is
no value of Attributes that means "leave the panel's alone" separately
from "add none of my own".
Colour of the underline, when the terminal supports colouring it separately from the text.
A copy carrying an underline. Terminals without ExtendedUnderline
render every style as a plain one, and without UnderlineColor ignore
color.