GamutDesk Logo
GamutDesk

HEX to Flutter Dart Color Code Formatter

Convert HEX to Flutter Dart const Color(0xFFRRGGBB) with an alpha channel, plus Color.fromRGBO output. Instant, private and ready to paste.

Client-Side ArchitecturePrivate Client-Side Processing

Color

100%

Generated code

Dart (ARGB integer)
const Color(0xFF3B82F6)
Dart (fromRGBO)
const Color.fromRGBO(59, 130, 246, 1.0)

Technical Specification & Mathematical Principles

How the Flutter Color Code Generator Works

Flutter's Color class wraps a 32-bit ARGB integer. The first byte is alpha, then red, green and blue, so a fully opaque #3B82F6 is written const Color(0xFF3B82F6). Setting the opacity slider to 50% changes the prefix from FF to 80 because 0.5 x 255 rounds to 128, which is 0x80.

The alternative constructor Color.fromRGBO(r, g, b, opacity) takes decimal channels and a 0 to 1 opacity. It is more readable when the alpha value matters, and the generator prints both forms.

Frequently Asked Questions

Why does Flutter use 0xFF instead of #?
Dart has no HEX color literal. The 0x prefix writes a hexadecimal integer, and the leading FF is the alpha byte, meaning fully opaque.
Can I make the color const?
Yes. Both Color(0x...) and Color.fromRGBO(...) are const constructors, so you can use them in const widgets and theme definitions.
How do I get a transparent variant of an existing color?
Use color.withValues(alpha: 0.5) in current Flutter versions, or generate a new constant here with the alpha slider.

Related Design & Color Instruments