encodeColor static method
Encodes the given value
to the String representation. This will always
use a hash encoded 8 digit string: "#aarrbbgg" format.
This will return null
if the value is null
.
Implementation
static String? encodeColor(Color? value) {
String? result;
if (value != null) {
final hex = value.value.toRadixString(16).padLeft(8, '0');
result = '#$hex';
}
return result;
}