Skip to content

Commit cd82a27

Browse files
committed
chore(release): version 0.8.0
1 parent a603e55 commit cd82a27

File tree

4 files changed

+16
-12
lines changed

4 files changed

+16
-12
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## 0.8.0
2+
3+
- Added RGB color parsing support
4+
- **Breaking Change**:
5+
- Updated color representations to classes
6+
- Removed/modified public API properties for `ColorToken`
7+
18
## 0.7.0
29

310
- Improve parsing logic & stability

README.md

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ import 'package:terminal_color_parser/terminal_color_parser.dart';
88
99
final coloredText = ColorParser('Hello, \x1B[32mworld\x1B[0m!').parse();
1010
11-
print(coloredText);
12-
// ==> ColorToken("Hello, ", 0:0, , ()), ColorToken("world", 32:0, , ()), ColorToken("!", 0:0, , ())]
13-
1411
var i = 0;
1512
for (final token in coloredText) {
1613
print('Token #$i: ${token.formatted}');
@@ -29,22 +26,22 @@ You can also re-format the ANSI codes by using the `formatted` property on each
2926

3027
```dart
3128
final tokens = [
32-
ColorToken(text: 'Hello, ', fgColor: 0, bgColor: 0),
29+
ColorToken(text: 'Hello, '),
3330
ColorToken(
3431
text: 'world',
35-
fgColor: 32,
36-
bgColor: 0,
32+
fgColor: ANSIColor.fg(32), // Can also use RGBColor.fg(r, g, b)
33+
bgColor: Color.none,
3734
styles: {StyleByte.underline},
3835
),
39-
ColorToken(text: '!', fgColor: 0, bgColor: 0),
36+
ColorToken(text: '!'),
4037
];
4138
4239
var i = 0;
4340
for (final token in coloredText) {
4441
print('Token #$i: ${token.formatted}');
4542
print(' - Text: ${token.text}');
46-
print(' - Foreground: ${token.fgColor}');
47-
print(' - Background: ${token.bgColor}');
43+
print(' - Foreground: ${token.fgColor.formatted}');
44+
print(' - Background: ${token.bgColor.formatted}');
4845
print(' - Bold: ${token.bold}');
4946
print(' - Italic: ${token.italic}');
5047
print(' - Underline: ${token.underline}');

example/example.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ void main(List<String> args) async {
2424
fgColor: Color.fg(32),
2525
styles: {TermStyle.underline,TermStyle.reset},
2626
),
27-
ColorToken(text: '!'),
27+
ColorToken(text: '!', styles: {TermStyle.bold}),
2828
];
2929

3030
i = 0;
@@ -38,7 +38,7 @@ void main(List<String> args) async {
3838
}
3939

4040
void dbg(int i, ColorToken token) {
41-
print('Token #$i: ${token.formatted}');
41+
print('Token #$i: ${token.formatted}\x1B[0m');
4242
print(' - Text: ${token.text}');
4343
print(' - Foreground: ${token.fgColor}');
4444
print(' - Background: ${token.bgColor}');

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: terminal_color_parser
22
description: Parse terminal colors for displaying in other formats. Supports ANSI and xterm256.
3-
version: 0.7.0
3+
version: 0.8.0
44
repository: https://github.com/chenasraf/terminal_color_parser_dart
55

66
environment:

0 commit comments

Comments
 (0)