syntax_noir library

Terminal widgets for syntax on noir: syntax highlighting with TextMate grammars and VS Code themes.

noir and syntax both export DiffLine, DiffHunk and DiffLineKind, so import syntax with a prefix:

import 'package:noir/noir.dart';
import 'package:syntax_core/syntax.dart' as syntax;
import 'package:syntax_noir/syntax_noir.dart';

Classes

PatchPainter
Paints the rows from syntax's layoutDiff as noir text, one terminal line per row.
PatchView
A syntax-highlighted view of code changes for the terminal.
SyntaxCodeHighlighter
A noir CodeHighlighter backed by syntax, for noir's CodeView.

Functions

noirColor(int argb, {int? over}) → Color
An ARGB color from syntax as a noir Color. Terminals don't blend, so a translucent color is first painted over over when given.
noirTextStyle(TokenStyle style, {required int background}) → TextStyle
A syntax token style as a noir TextStyle. Translucent colors are painted over background, the color behind the text. The style sets a background only when the token has its own.