background method

String background(
  1. String text
)

Creates a string that applies this color as a background color to text.

Implementation

String background(String text) {
  return '\x1b[48;2;$r;$g;${b}m$text\x1b[0m';
}