New in Formulas 2.0
The style()
function will add formatting to a string. Accepted styles include bold, underline, italics, code, and strikethrough for formatting, and both text and background colors.
style(string, formatting, textColor, backgroundColor)
string.style(formatting, textColor, backgroundColor)
Code language: JavaScript (javascript)
Each formatting or color option must have its own argument ("b", "u", "blue", "red_background"
), and the order of the arguments does not matter.
Example Formulas
style("Thomas Frank", "b", "i", "blue")
"College Info Geek".style("s", "yellow_background")
Code language: JavaScript (javascript)
Available Arguments
Formatting
"b"
→ Bold"u"
→ Underline"i"
→ Italics"c"
→Code
"s"
→Strikethrough
Colors
Only one text color and one background color can be set per string using the following arguments. If multiple text or background color arguments are added the last argument will be used.
Color | Text | Background |
---|---|---|
Default | "default" | n/a |
Gray | "gray" | "gray_background" |
Brown | "brown" | "brown_background" |
Orange | "orange" | "orange_background" |
Yellow | "yellow" | "yellow_background" |
Green | "green" | "green_background" |
Blue | "blue" | "blue_background" |
Purple | "purple" | "purple_background" |
Pink | "pink" | "pink_background" |
Red | "red" | "red_background" |