setForegroundColor256 method

void setForegroundColor256(
  1. int index
)

Sets the foreground to palette colour index (0–255).

Implementation

void setForegroundColor256(int index) {
  if (index < 0 || index > 255) return;
  _sgr('38;5;$index');
}