hex to Flutter Color
Flutter packs alpha first, so a fully opaque colour starts with 0xFF. Dropping the alpha byte gives a fully transparent colour, which is the classic Flutter colour bug.
Color(0xFF4287F5)Paste a hex value — other formats work too.
Need every format at once? Open in the full picker
Worked examples
Common colours converted from hex to Flutter Color, computed with the same engine the picker uses.
| Colour | hex | Flutter Color | Copy |
|---|---|---|---|
| Pure red | #ff0000 | Color(0xFFFF0000) | |
| Pure green | #00ff00 | Color(0xFF00FF00) | |
| Pure blue | #0000ff | Color(0xFF0000FF) | |
| White | #ffffff | Color(0xFFFFFFFF) | |
| Mid grey | #808080 | Color(0xFF808080) | |
| Black | #000000 | Color(0xFF000000) | |
| Interface blue | #4287f5 | Color(0xFF4287F5) | |
| Success green | #22c55e | Color(0xFF22C55E) | |
| Danger red | #ef4444 | Color(0xFFEF4444) | |
| Warning amber | #f59e0b | Color(0xFFF59E0B) | |
| Editor black | #1e1e1e | Color(0xFF1E1E1E) | |
| Warm sand | #e9c46a | Color(0xFFE9C46A) |
How the conversion works
Flutter packs alpha first, so a fully opaque colour starts with 0xFF. Dropping the alpha byte gives a fully transparent colour, which is the classic Flutter colour bug.
Both formats are computed from a single canonical representation — CIE XYZ with a D65 white point, held in floating point — rather than by chaining one format into the next. That matters because chained conversions accumulate rounding error, and because it means a colour that cannot be represented in the target format is handled deliberately rather than by accident.
When the source describes a colour outside the target's gamut, chroma is reduced in OKLCh while lightness and hue are held, following the CSS Color 4 gamut mapping algorithm. Clipping each channel independently would be simpler but visibly shifts hue on saturated colours.