Search packages, repositories and app categories

Package detailsv3.0.0

console_color

The convenient enum of 256 colors for console. This library gives the color code for the console an easily recognizable name.

AndroidiOSLinuxmacOSWebWindows
30-day downloads
32.9K
Likes
3
Pub points
160

Install package

flutter pub add console_color

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

console_color is a Flutter/Dart package that provides a convenient enum of 256 console colors, assigning easily recognizable names to color codes. It simplifies terminal output formatting by allowing developers to use descriptive color names instead of raw ANSI codes. Ideal for logging, debugging, and enhancing console readability in command-line applications across multiple platforms.

Use cases

  • Enhancing console logs with color
  • Debugging applications via colored output
  • Improving terminal-based UIs
  • Customizing CLI tool outputs
  • Logging with visual hierarchy

Key features

  • 256 predefined console colors
  • Simple enum-based API
  • Readable color names
  • Cross-platform support
  • Easy integration with print statements

Suitable for

  • Developers building CLI tools
  • Teams improving debug visibility
  • Educational projects using console output
  • Applications requiring terminal colorization

Considerations

  • Limited to console output only
  • No runtime color customization
  • Depends on terminal support for ANSI colors
  • Not suitable for GUI applications
  • Colors may not render consistently across all terminals

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

1. About

The convenient enum of 256 colors for console. Console Color gives the color code for the console an easily recognizable name.

1.1. Introduction

1.1.1. Install Library

With Dart:

 dart pub add console_color

With Flutter:

 flutter pub add console_color
1.1.2. Import It
import 'package:console_color/console_color.dart';
1.1.3. Use library
import 'package:console_color/console_color.dart';

void main() {
  final color = ConsoleColor.cyan;
  print(color.name);
  print(color.code);

  for (final color in ConsoleColor.values) {
    print('name=${color.name}');
    print('code=${color.code}');
  }
}

1.2. License

Copyright (c) 2022, Kato Shinya. All rights reserved.
Use of this source code is governed by a
BSD-style license that can be found in the LICENSE file.

1.3. More Information

Console Color was designed and implemented by Kato Shinya.

Categories

Source repository

Projects using this package

No data available yet.

Rankings