Function Terminal.setTrueColor

Attempts to set color according to a 24 bit value (r, g, b, each >= 0 and < 256).

bool setTrueColor (
  RGB foreground,
  RGB background,
  ForceOption force = ForceOption.automatic
);

This is not supported on all terminals. It will attempt to fall back to a 256-color or 8-color palette in those cases automatically.

Returns

true if it believes it was successful (note that it cannot be completely sure), false if it had to use a fallback.