Search packages, repositories and app categories

Package detailsv3.1.3

hexcolor

Brings HexColor for your dart and flutter projects, convert material colors to hex colors

AndroidiOSWebmacOSWindowsLinux
30-day downloads
30.4K
Likes
335
Pub points
150

Install package

flutter pub add hexcolor

Package Overview

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

HexColor is a lightweight Dart package that enables seamless conversion between Material color constants and their hexadecimal representations in Flutter projects. It simplifies color management by allowing developers to easily create Color objects from hex strings, enhancing consistency and readability in UI design. The package supports all major platforms including Android, iOS, Web, macOS, Windows, and Linux, making it ideal for cross-platform applications. With straightforward syntax and minimal overhead, HexColor streamlines the process of working with colors in Flutter apps.

Use cases

  • Converting Material color constants to hex
  • Creating custom colors from hex values
  • Simplifying color management in UI design
  • Using consistent colors across multiple platforms
  • Integrating design tokens from Figma or Sketch

Key features

  • Easy hex string to Color conversion
  • Supports all Flutter platforms
  • Minimal performance impact
  • Simple API with intuitive methods
  • Compatible with Material color system

Suitable for

  • Flutter developers managing color schemes
  • Designers integrating design files into code
  • Projects requiring precise color control
  • Cross-platform mobile and web apps
  • Apps using design system tokens

Considerations

  • Requires manual hex string validation
  • Does not support alpha transparency in basic usage
  • Limited to color conversion, not full color manipulation
  • No built-in color palette generation
  • Not intended for complex color theory operations

Original README

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

License: BSD 3 Pub.dev 213

hexcolor_example

hex color plugin allows you to add hex color codes to your flutter projects

Getting Started

sample usage

import 'package:hexcolor/hexcolor.dart';
  Text("Hello There!", style: TextStyle(color: HexColor("#009688"))),
        ElevatedButton(
          onPressed: () {
            setState(() {
              colorCode = Colors.teal.toHex();
            });
          },
          child: Text('Get Hex Color $colorCode'),
        ),
HexColor("#yourhex")

"Buy Me A Coffee"

Categories

Source repository

Projects using this package