onRgb method Null safety

String onRgb(
  1. {int r = 255,
  2. int g = 255,
  3. int b = 255}
)

Format this string with ANSI setting it's background color the value defined as RGB parameters.

r/g/b parameters can be an int in the range of 0 to 255.

Implementation

String onRgb({int r = 255, int g = 255, int b = 255}) {
  return format('48;5;${rgbToAnsiCode(r, g, b)}', 0)(this);
}