ChalkString extension

Extensions on the String class that allow you to use the Chalk methods directly on Strings, ie. 'This will be red italic'.red.italic 'This will be red on yellow background'.red.onYellow

on

Properties

bgBlack String
no setter
bgBlackBright String
no setter
bgBlue String
no setter
bgBlueBright String
no setter
bgBrightBlack String
no setter
bgBrightBlue String
no setter
bgBrightCyan String
no setter
bgBrightGreen String
no setter
bgBrightMagenta String
no setter
bgBrightRed String
no setter
bgBrightWhite String
no setter
bgBrightYellow String
no setter
bgCyan String
no setter
bgCyanBright String
no setter
bgGray String
no setter
bgGreen String
no setter
bgGreenBright String
no setter
bgGrey String
no setter
bgMagenta String
no setter
bgMagentaBright String
no setter
bgRed String
no setter
bgRedBright String
no setter
bgWhite String
no setter
bgWhiteBright String
no setter
bgYellow String
no setter
bgYellowBright String
no setter
black String
no setter
blackBright String
no setter
blackletter String
no setter
no setter
blue String
no setter
blueBright String
no setter
bold String
no setter
brightBlack String
no setter
brightBlue String
no setter
brightCyan String
no setter
brightGreen String
no setter
brightMagenta String
no setter
brightRed String
no setter
brightWhite String
no setter
brightYellow String
no setter
cyan String
no setter
cyanBright String
no setter
dim String
no setter
doubleUnderline String
no setter
doubleunderline String
no setter
doubleunderlined String
no setter
font1 String
no setter
font2 String
no setter
font3 String
no setter
font4 String
no setter
font5 String
no setter
font6 String
no setter
font7 String
no setter
font8 String
no setter
font9 String
no setter
font10 String
no setter
gray String
no setter
green String
no setter
greenBright String
no setter
grey String
no setter
hidden String
no setter
inverse String
no setter
invert String
no setter
italic String
no setter
magenta String
no setter
magentaBright String
no setter
normal String
no setter
onBlack String
no setter
onBlue String
no setter
onBrightBlack String
no setter
onBrightBlue String
no setter
onBrightCyan String
no setter
onBrightGreen String
no setter
onBrightMagenta String
no setter
onBrightRed String
no setter
onBrightWhite String
no setter
onBrightYellow String
no setter
onCyan String
no setter
onGray String
no setter
onGreen String
no setter
onGrey String
no setter
onMagenta String
no setter
onRed String
no setter
onWhite String
no setter
onYellow String
no setter
overline String
no setter
overlined String
no setter
no setter
red String
no setter
redBright String
no setter
reset String
no setter
strikethrough String
no setter
strip String
no setter
subscript String
no setter
superscript String
no setter
underline String
no setter
underlined String
no setter
visible String
no setter
white String
no setter
whiteBright String
no setter
yellow String
no setter
yellowBright String
no setter

Methods

ansi(int ansicode) String
Creates String with the foreground color specified by the ansi color escape code. https://en.wikipedia.org/wiki/ANSI_escape_code
ansi256(int ansicode256) String
https://en.wikipedia.org/wiki/ANSI_escape_code
ansiSgr(dynamic openCode, dynamic closeCode) String
https://en.wikipedia.org/wiki/ANSI_escape_code
bgAnsi(int ansicode) String
Alternate name for onAnsi() (provided for legacy compatibility with JS Chalk)
bgAnsi256(int ansicode256) String
Alternate name for onAnsi256() (provided for legacy compatibility with JS Chalk)
bgGreyscale(num greyscale) String
Alternate name for onGreyscale() (provided for legacy compatibility with JS Chalk)
bgHex(dynamic hex) String
Alternate name for onHex() (provided for legacy compatibility with JS Chalk).
bgHsl(num hue, num saturation, num lightness) String
Alternate name for onHsl() (provided for legacy compatibility with JS Chalk)
bgHsv(num hue, num saturation, num value) String
Alternate name for onHsv() (provided for legacy compatibility with JS Chalk)
bgHwb(num hue, num whiteness, num blackness) String
Alternate name for onHwb() (provided for legacy compatibility with JS Chalk)
bgKeyword(String colorKeyword) String
Alternate name for onKeyword() (provided for legacy compatibility with JS Chalk).
bgLab(num l, num a, num b) String
Alternate name for onLab() (provided for legacy compatibility with JS Chalk)
bgRgb(num red, num green, num blue) String
Alternate name for onRgb() (provided for legacy compatibility with JS Chalk).
bgRgb16m(num red, num green, num blue) String
Alternate name for onRgb16m() (provided for legacy compatibility with JS Chalk).
bgXyz(num x, num y, num z) String
Alternate name for onXyz() (provided for legacy compatibility with JS Chalk)
greyscale(num greyscale) String
hex(dynamic hex) String
Returns a String with the foreground color set to the passed in RGB Hex code. This dynamically accepts color hex codes as integer codes (0xAABBCC) or (0xABC) or as strings ('#AABBCC') or ('#ABC')
hsl(num hue, num saturation, num lightness) String
Creates String with foreground color defined from HSL (Hue, Saturation and Lightness) color space parameters. https://en.wikipedia.org/wiki/HSL_and_HSV
hsv(num hue, num saturation, num value) String
Creates String with foreground color defined from HSV (Hue, Saturation and Value) color space parameters. https://en.wikipedia.org/wiki/HSL_and_HSV
hwb(num hue, num whiteness, num blackness) String
Creates String with foreground color defined from HWB (Hue, Whiteness and Blackness) color space parameters. https://en.wikipedia.org/wiki/HWB_color_model
keyword(String colorKeyword) String
Returns a String with the foreground color set to the color represented by the passed in color keyword. This accepts all of the standard X11/CSS/SVG color names, and the user can extend the list of accepted color keywords using the addColorKeywordRgb() and addColorKeywordHex() methods
lab(num l, num a, num b) String
Creates String with foreground color defined from lab color space parameters. https://en.wikipedia.org/wiki/CIELAB_color_space#CIELAB
onAnsi(int ansicode) String
Creates String with the background color specified by the ansi color escape code. https://en.wikipedia.org/wiki/ANSI_escape_code
onAnsi256(int ansicode256) String
https://en.wikipedia.org/wiki/ANSI_escape_code
onGreyscale(num greyscale) String
onHex(dynamic hex) String
Returns a String with the background color set to the passed in RGB Hex code. This dynamically accepts color hex codes as integer codes (0xAABBCC) or (0xABC) or as strings ('#AABBCC') or ('#ABC')
onHsl(num hue, num saturation, num lightness) String
Creates String with background color defined from HSL (Hue, Saturation and Lightness) color space parameters. https://en.wikipedia.org/wiki/HSL_and_HSV
onHsv(num hue, num saturation, num value) String
Creates chalk with background color defined from HSV (Hue, Saturation and Value) color space parameters. https://en.wikipedia.org/wiki/HSL_and_HSV
onHwb(num hue, num whiteness, num blackness) String
Creates String with background color defined from HWB (Hue, Whiteness and Blackness) color space parameters. https://en.wikipedia.org/wiki/HWB_color_model
onKeyword(String colorKeyword) String
Returns a String with the background color set to the color represented by the passed in color keyword. This accepts all of the standard X11/CSS/SVG color names, and the user can extend the list of accepted color keywords using the addColorKeywordRgb() and addColorKeywordHex() methods
onLab(num l, num a, num b) String
Creates String with background color defined from lab color space parameters. https://en.wikipedia.org/wiki/CIELAB_color_space#CIELAB
onRgb(num red, num green, num blue) String
Create String with a background color with the specified RGB values.
onRgb16m(num red, num green, num blue) String
Create String with a background color with the specified RGB values (forces using ANSI 16m SGR codes, even if level is not 3).
onXyz(num x, num y, num z) String
Creates String with background color defined from XYZ color space parameters. https://en.wikipedia.org/wiki/CIE_1931_color_space
rgb(num red, num green, num blue) String
Create String with a foreground color with the specified RGB values.
rgb16m(num red, num green, num blue) String
Create String with a foreground color with the specified RGB values (forces using ANSI 16m SGR codes, even if level is not 3).
underlineRgb(num red, num green, num blue) String
Create String with an underline of the the specified RGB color WARNING: on some consoles without support for this, such as Android Studio, using this will prevent ALL styles of the Chalk from appearing
underlineRgb16m(num red, num green, num blue) String
Create String with an underline of the the specified RGB color (forces using ANSI 16m SGR codes, even if level is not 3) WARNING: on some consoles without support for this, such as Android Studio, using this will prevent ALL styles of the Chalk from appearing
wrap(String prefix, String suffix) String
Wrap this chalk with specified prefix and suffix strings.
xyz(num x, num y, num z) String
Creates String with foreground color defined from XYZ color space parameters. https://en.wikipedia.org/wiki/CIE_1931_color_space