resolve method

UvCellPaint resolve(
  1. UvStyle style
)

Resolves a style into the colors actually used to paint a cell.

Implementation

UvCellPaint resolve(UvStyle style) {
  var fg = resolveColor(style.fg, foreground);
  var bg = resolveColor(style.bg, background);
  if ((style.attrs & Attr.reverse) != 0) (fg, bg) = (bg, fg);
  if ((style.attrs & Attr.faint) != 0) {
    fg = _mix(fg, bg, faintMix);
  }
  if ((style.attrs & Attr.conceal) != 0) fg = bg;
  final underline = resolveColor(style.underlineColor, fg);
  return UvCellPaint(
    foreground: fg,
    background: bg,
    underlineColor: underline,
  );
}