hexFromColor function

String hexFromColor(
  1. Color color
)

Converts a Flutter Color to hexadecimal string representation.

Returns a hex string with hash prefix (e.g., "#RRGGBB" or "#AARRGGBB").

Parameters:

  • color (Color, required): Color to convert

Returns hex string representation.

Implementation

String hexFromColor(Color color) {
  return colorToHex(color, true);
}