io.sureshg.extn / kotlin.String / color256

color256

fun String.color256(code: Int, fg: Boolean = true): String

Returns 256-color extended color set (From 0 to 255) formatted string.

Parameters

code - color code in the range 0 to 255. fg - true for foreground color, otherwise background. Default is true