chalkdart
Console/Logging text coloring and styling library for Dart. 'Terminal string styling done right' The default mode uses ANSI codes to style the text for Console/Terminal display. HTML mode can be activated so that all text is colored and styled using HTML so ChalkDart can be use for sending colored/styled logs to the Server for viewing from a browser as well.
3.1.0
51K downloads/mo
#1453 most downloaded on pub.dev
timmaffett/chalkdart
What this package is like to depend on
Last release 6 months ago
15 Feb 2026
Release timing varies
gaps range from 2 weeks to 13 months
Nearly every release is documented
notes for 26 of 26 stable releases
Nothing withdrawn
no release was ever pulled
4 years old
26 releases · first in 2022
2 releases in the last 12 months
see the full history below
Release timeline
26 releases · May 2022 to Feb 2026Releases
latest 26-
3.1.015 Feb 2026Release notes
Open source →- Performance optimization release — significant speed improvements across all major code paths.
- String Extension Getters — 7-10x faster (base16 and X11/CSS colors)
- X11/CSS String Extension Getters — 3-4x faster via list-based cache
- Chalk Getter Chains — 4-6x faster
- ANSI SGR Code Generation — cached
- Multi-line Text Processing — 4-6x faster
- Hex Color Parsing — 13x faster
- Added
PERF_RECOMMENDATIONS_AND_IMPROVEMENTS.mdwith practical performance guidance for library users - Added comprehensive performance benchmark suite under
test/perf_*.dart - Expanded test coverage from 493 to 515 tests
-
3.0.614 Feb 2026Release notes
Open source →- setDefaultOutputMode now re-initializes the chalkstrings also
- Move args package dependency to dev-dependencies
- clean up dart analyze messages
- expand dart test from 7 to 493
-
3.0.516 Apr 2025Release notes
Open source →- Added xterm() method as alternate way of creating ANSI/Xterm colors (instead of using ansi() or onAnsi())
- Added export of src/chalk_x11.g.dart to package:chalkdart/chalkstrings.dart so that color extensions are available for chalk as well as the string extensions.
- Added [AnsiStringUtils] String extension to ansiutil.dart for with [lengthWithoutAnsi] and [stripAnsi] getters so the length of a string not including hidden ansi codes can be calculated, or the codes can be removed.
- Change to \x1B instead of \u001B for shorter strings and slightly faster parsing
-
3.0.425 Mar 2025 -
3.0.325 Mar 2025 -
3.0.225 Mar 2025 -
3.0.125 Mar 2025Release notes
Open source →- Fix minor error of old ChalkWhitespaceStyle instead of ChalkWhitespaceTreatment
- Added note about being about to use any valid
white-spaceCSS value for [whiteSpaceTreatment]
-
3.0.025 Mar 2025Release notes
Open source →- add support for HTML output mode with new supporting methods for Chalk and Chalk string support The intention of this is to allow the use of Chalk for loggers which may be sending output to a server/database for viewing in a browser or other html capable viewer. The viewed HTML will appear as it does in the VSCode debug console.
New HTML Output Features:
-
Output Mode Control:
Chalk.setDefaultOutputMode = ChalkOutputMode.htmlto set default mode to html for future constructed Chalk objectschalk.setOutputMode = ChalkOutputMode.htmlto set the output mode on an existing Chalk object- Use [ChalkOutputMode.ansi] to change back to ANSI mode (default unless explicitly set to html)
-
Color Scheme Support:
Chalk.defaultHtmlBasicANSIColorSetproperty for setting default color schemeChalk.setDefaultHtmlBasicANSIColorSetmethod for changing color scheme- Available schemes: [ChalkAnsiColorSet.lightBackground], [ChalkAnsiColorSet.darkBackground], [ChalkAnsiColorSet.highContrast]
-
HTML Safety Methods:
chalk.stripHtmlTags()- Removes HTML tags from textChalk.htmlSafeSpaces()- Preserves spaces in HTML outputChalk.htmlSafeGtLt()- Converts < and > to HTML entitiesChalk.htmlSafeEntities()- Converts all HTML special characters to entities
-
Stylesheet Generation:
chalk.stylesheet()- Generates CSS styles for HTML outputchalk.inlineStylesheet()- Generates CSS wrapped in <style> tags- Customizable options for:
- Color schemes
- Whitespace treatment
- Custom colors
- Font families (10 customizable slots)
-
String Extension Methods:
- Added
stripHtmlTagsfor removing HTML tags - Added
htmlSafeGtLtfor safe HTML character conversion - Added
htmlSafeSpacesfor space preservation - Added
htmlSafeEntitiesfor entity conversion - Extended
stripto handle HTML tags when in HTML mode
- Added
-
Example Command Line Options:
- Added HTML output examples:
dart run chalkdart_example.dart --html --light >testlightmode.html dart run chalkdart_example.dart --html --highcontrast >testhighcontrastmode.html dart run chalkdart_example.dart --html --dark >testdarkmode.html
- Added HTML output examples:
-
2.4.022 Mar 2025Release notes
Open source →- add the first ever color debugging support for Flutter apps within VSCode via XCode.
Chalk.xcodeSafeEsc = true;to activate XCode safe mode. (Requires the use of my "XCode Flutter Color Debugging" VSCode Extension found at https://marketplace.visualstudio.com/items?itemName=HiveRight.xcodefluttercolordebugging) - Update docs in README.md and change out inline base64 url images for server pngs (The inline base64 encoded url images no longer worked on pub.dev/github)
- add the first ever color debugging support for Flutter apps within VSCode via XCode.
-
2.3.310 Mar 2025Release notes
Open source →- add Wasm support, Since dart:html is not supported when compiling to Wasm, the correct alternative now is to use dart.library.js_interop to differentiate between native and web.
- Add topics to pubspec.yaml
-
2.3.203 Feb 2025 -
2.3.103 Feb 2025Release notes
Open source →- Dart format code and fix make_css_x11_methods.dart so it outputs correct dart format.
-
2.3.002 Feb 2025Release notes
Open source →- Added support for color previews to all dart docs using Markdown images and inline SVGs. VSCode supports this.
- Completed the dart docs for all of the string extension methods, including new color previews.
- Always include all X11/CSS colors without having to import the _x11 variants of the chalk files.
-
2.2.118 Jan 2024 -
2.2.016 Jan 2024Release notes
Open source →- Extended make_css_x11_methods.dart to have capability to generate extensions to String class for all the X11/Css color methods from chalk_x11.dart
- Added
chalkstrings_x11.dartclass for adding X11 Chalk methods as extensions to String class
-
2.0.919 Jan 2023 -
2.0.816 May 2022 -
2.0.712 May 2022 -
2.0.612 May 2022 -
2.0.512 May 2022 -
2.0.412 May 2022 -
2.0.312 May 2022 -
2.0.212 May 2022Release notes
Open source →- Add link to readme to dart docs on timmaffett.github.io/chalkdart_docswhich have full color docs because they don't work on github/pub.dev from README.md
-
2.0.112 May 2022Release notes
Open source →- Remove html/script sorted table from readme and docs - they don't work on github/pub.dev
-
2.0.012 May 2022 -
1.0.012 May 2022