Skip to content

Commit 0faaa9a

Browse files
authored
Merge pull request #15 from MichaelRFairhurst/add-void-annotations
Changes for landing dart-lang/sdk#32161
2 parents af0e443 + 1acc5b0 commit 0faaa9a

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

lib/ansicolor.dart

+12-11
Original file line numberDiff line numberDiff line change
@@ -53,28 +53,29 @@ class AnsiPen {
5353
/// attributes.
5454
String write(String msg) => "${this}$msg$up";
5555

56-
black({bool bg: false, bool bold: false}) => _std(0, bold, bg);
57-
red({bool bg: false, bool bold: false}) => _std(1, bold, bg);
58-
green({bool bg: false, bool bold: false}) => _std(2, bold, bg);
59-
yellow({bool bg: false, bool bold: false}) => _std(3, bold, bg);
60-
blue({bool bg: false, bool bold: false}) => _std(4, bold, bg);
61-
magenta({bool bg: false, bool bold: false}) => _std(5, bold, bg);
62-
cyan({bool bg: false, bool bold: false}) => _std(6, bold, bg);
63-
white({bool bg: false, bool bold: false}) => _std(7, bold, bg);
56+
void black({bool bg: false, bool bold: false}) => _std(0, bold, bg);
57+
void red({bool bg: false, bool bold: false}) => _std(1, bold, bg);
58+
void green({bool bg: false, bool bold: false}) => _std(2, bold, bg);
59+
void yellow({bool bg: false, bool bold: false}) => _std(3, bold, bg);
60+
void blue({bool bg: false, bool bold: false}) => _std(4, bold, bg);
61+
void magenta({bool bg: false, bool bold: false}) => _std(5, bold, bg);
62+
void cyan({bool bg: false, bool bold: false}) => _std(6, bold, bg);
63+
void white({bool bg: false, bool bold: false}) => _std(7, bold, bg);
6464

6565
/// Sets the pen color to the rgb value between 0.0..1.0.
66-
rgb({r: 1.0, g: 1.0, b: 1.0, bool bg: false}) => xterm(
66+
void rgb({r: 1.0, g: 1.0, b: 1.0, bool bg: false}) => xterm(
6767
(r.clamp(0.0, 1.0) * 5).toInt() * 36 +
6868
(g.clamp(0.0, 1.0) * 5).toInt() * 6 +
6969
(b.clamp(0.0, 1.0) * 5).toInt() +
7070
16,
7171
bg: bg);
7272

7373
/// Sets the pen color to a grey scale value between 0.0 and 1.0.
74-
gray({level: 1.0, bool bg: false}) =>
74+
void gray({level: 1.0, bool bg: false}) =>
7575
xterm(232 + (level.clamp(0.0, 1.0) * 23).round(), bg: bg);
7676

77-
_std(int color, bool bold, bool bg) => xterm(color + (bold ? 8 : 0), bg: bg);
77+
void _std(int color, bool bold, bool bg) =>
78+
xterm(color + (bold ? 8 : 0), bg: bg);
7879

7980
/// Directly index the xterm 256 color palette.
8081
void xterm(int color, {bool bg: false}) {

0 commit comments

Comments
 (0)