rgb method

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

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

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

Implementation

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