foreground method

String foreground(
  1. String text
)

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

Implementation

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