toRGBFunction method

String toRGBFunction(
  1. Contexts context
)

=> 'rgba(r, g, b, a)'

Implementation

String toRGBFunction(Contexts context) {
  final formatter = AlphaFormatter(context)
    ..removeLeadingZero = cleanCss != null;
  final separator = _isCompress(context) ? ',' : ', ';

  final arguments = <String>[
    for (var c in rgb) c.round().toString(),
    formatter.format(alpha),
  ].join(separator);

  return 'rgba($arguments)';
}