Line to tint.
Output range sink to fill with the function's output.
Foreground IRCColour integer.
Optional background IRCColour integer.
import std.array : Appender; alias I = IRCControlCharacter; Appender!(char[]) sink; "kameloso".ircColourInto(sink, IRCColour.red, IRCColour.white); assert((sink.data == I.colour ~ "04,00kameloso" ~ I.colour), sink.data); sink.clear(); "harbl".ircColourInto(sink, IRCColour.green); assert((sink.data == I.colour ~ "03harbl" ~ I.colour), sink.data);
Colour-codes the passed string with mIRC colouring, foreground and background. Takes an output range sink and writes to it instead of allocating a new string.