ChromaTheme class
Configuration for syntax highlighting colors.
Inspired by Glamour's Chroma integration, this provides granular control over token colors for syntax highlighting using artisanal's Style system.
final theme = ChromaTheme.dark;
// Or create a custom theme
final customTheme = ChromaTheme(
keyword: Style().foreground(Colors.blue).bold(),
string: Style().foreground(Colors.green),
comment: Style().foreground(Colors.gray).italic(),
);
Constructors
- ChromaTheme({Style? text, Style? error, Style? comment, Style? commentPreproc, Style? keyword, Style? keywordReserved, Style? keywordNamespace, Style? keywordType, Style? operator, Style? punctuation, Style? name, Style? nameBuiltin, Style? nameTag, Style? nameAttribute, Style? nameClass, Style? nameConstant, Style? nameDecorator, Style? nameException, Style? nameFunction, Style? nameOther, Style? literal, Style? literalNumber, Style? literalDate, Style? literalString, Style? literalStringEscape, Style? genericDeleted, Style? genericEmph, Style? genericInserted, Style? genericStrong, Style? genericSubheading, Style? background})
-
const
-
ChromaTheme.fromJson(Map<
String, dynamic> json) -
Creates a theme from a JSON map.
factory
Properties
- background → Style?
-
final
- comment → Style?
-
final
- commentPreproc → Style?
-
final
- error → Style?
-
final
- genericDeleted → Style?
-
final
- genericEmph → Style?
-
final
- genericInserted → Style?
-
final
- genericStrong → Style?
-
final
- genericSubheading → Style?
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- keyword → Style?
-
final
- keywordNamespace → Style?
-
final
- keywordReserved → Style?
-
final
- keywordType → Style?
-
final
- literal → Style?
-
final
- literalDate → Style?
-
final
- literalNumber → Style?
-
final
- literalString → Style?
-
final
- literalStringEscape → Style?
-
final
- name → Style?
-
final
- nameAttribute → Style?
-
final
- nameBuiltin → Style?
-
final
- nameClass → Style?
-
final
- nameConstant → Style?
-
final
- nameDecorator → Style?
-
final
- nameException → Style?
-
final
- nameFunction → Style?
-
final
- nameOther → Style?
-
final
- nameTag → Style?
-
final
- operator → Style?
-
final
- punctuation → Style?
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- text → Style?
-
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- dark → ChromaTheme
-
Default dark theme inspired by Glamour/Charm.
no setter
- dracula → ChromaTheme
-
Dracula-inspired theme.
no setter
- github → ChromaTheme
-
GitHub-inspired theme (light).
no setter
- gruvboxDark → ChromaTheme
-
Gruvbox Dark theme.
no setter
- gruvboxLight → ChromaTheme
-
Gruvbox Light theme.
no setter
- light → ChromaTheme
-
Light theme for light terminal backgrounds.
no setter
- monokai → ChromaTheme
-
Monokai-inspired theme.
no setter
- nord → ChromaTheme
-
Nord theme (dark, inspired by arctic colors).
no setter
- oneDark → ChromaTheme
-
One Dark theme (Atom-inspired).
no setter
- oneLight → ChromaTheme
-
One Light theme (Atom-inspired).
no setter
- solarizedDark → ChromaTheme
-
Solarized Dark theme.
no setter
- solarizedLight → ChromaTheme
-
Solarized Light theme.
no setter