Color hexToColor(String hexColor) { String formattedColor = hexColor.replaceAll("#", ""); int colorValue = int.parse(formattedColor, radix: 16); return Color(colorValue).withAlpha(0xFF); }