mirror of
https://github.com/yamadapc/d-colorize
synced 2024-11-14 21:14:00 +01:00
Use const str
parameters.
This is a more reasonable approach.
This commit is contained in:
parent
9f4fddd188
commit
5f944fad66
|
@ -83,8 +83,12 @@ static enum mode : int
|
|||
* ---
|
||||
*/
|
||||
|
||||
string colorize(string str, fg c=fg.init, bg b=bg.init, mode m=mode.init)
|
||||
pure
|
||||
string colorize(
|
||||
const string str,
|
||||
const fg c=fg.init,
|
||||
const bg b=bg.init,
|
||||
const mode m=mode.init
|
||||
) pure
|
||||
{
|
||||
return format("\033[%d;%d;%dm%s\033[0m", m, c, b, str);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue