dstring` to tint.
Whether or not to use extended colours (16-98).
The passed dstring` encased within IRC colour coding.
alias I = IRCControlCharacter; // Colour based on hash { immutable actual = "kameloso".ircColourByHash(extendedOutgoingColours: true); immutable expected = I.colour ~ "23kameloso" ~ I.colour; assert((actual == expected), actual); } { immutable actual = "kameloso^".ircColourByHash(extendedOutgoingColours: true); immutable expected = I.colour ~ "56kameloso^" ~ I.colour; assert((actual == expected), actual); } { immutable actual = "kameloso^11".ircColourByHash(extendedOutgoingColours: true); immutable expected = I.colour ~ "91kameloso^11" ~ I.colour; assert((actual == expected), actual); } { immutable actual = "flerrp".ircColourByHash(extendedOutgoingColours: true); immutable expected = I.colour ~ "90flerrp" ~ I.colour; assert((actual == expected), actual); }
Returns the passed dstring coloured with an IRC colour depending on the hash of the string, making for good "random" (uniformly distributed) nick colours in IRC messages.