COLOR.LUA(8)
β¨ color.lua(8) β¨
ok so bestie, this is the man page for color.lua β straight out of the System Manager's Manual β and it's literally the bootloader color module. yes. colors. in your bootloader. we love to see it π
π NAME π
color.lua β the bootloader color module, aka the thing that makes your boot sequence not look like a sad gray void π¦
π DESCRIPTION π
color.lua contains functionality for working with colors. that's it. that's the vibe. β¨
Before you can use any of the functionality provided by color.lua, it must be included with a statement such as the following:
local color = require("color")
no cap, you gotta do that first or nothing works. π«Ά
π Color Constants π
The following color constants are exported from color.lua:
color.BLACK
color.RED
color.GREEN
color.YELLOW
color.BLUE
color.MAGENTA
color.CYAN
color.WHITE
the whole rainbow, iconic, no notes ππ
πΈ Attribute Constants πΈ
The following attribute constants are exported from color.lua:
color.DEFAULT
color.BRIGHT
color.DIM
three little vibes for your text. use them wisely. π
π§ Functions π§
The following functions are exported from color.lua β buckle up, there's a bunch:
color.isEnabled()β ReturnsTrueifloader(8)has been configured to not allow color,Falseotherwise. It checks theloader_colorloader.conf(5)variable, along withcore.isSerialBoot(). (yes,Truemeans color is not allowed β that's what it says, don't come for me π)color.escapefg(color_value)β Returns the escape sequence that encodescolor_valueas a foreground color.color.escapefg()returns an empty string if color is disabled.color.resetfg()β Returns the escape sequence for the default foreground color.color.resetfg()returns an empty string if color is disabled.color.escapebg(color_value)β Returns the escape sequence that encodescolor_valueas a background color.color.escapebg()returns an empty string if color is disabled.color.resetbg()β Returns the escape sequence for the default background color.color.resetbg()returns an empty string if color is disabled.color.escape(fg_color, bg_color, attribute)β Returns an escape sequence that encodesfg_coloras the foreground color,bg_coloras the background color, andattributeapplied.color.escape()returns an empty string if color is disabled.color.default()β Returns the escape sequence for the default color scheme, white on black with no attributes applied.color.default()returns an empty string if color is disabled.color.highlight(str)β Returnsstrwith thecolor.BRIGHTattribute applied before it and reset after it.color.highlight()returnsstrif color is disabled.
π heads up: like, half of these return an empty string when color is disabled. that's not a bug, that's the whole point β every single one of the escape-sequence functions bails gracefully.color.highlight()is the odd one out and gives you back yourstruntouched instead.
π¦ SEE ALSO π¦
π AUTHORS π
The color.lua file was originally written by Pedro Souza <pedrosouza@FreeBSD.org>. Later work and this manual page was done by Kyle Evans <kevans@FreeBSD.org>.
aaaand that's the whole thing, bestie π«Ά this page shipped with Debian, dated March 29, 2025 β go forth and color your bootloader, you absolute main character πβ¨π
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- π the page's license: BSD-2-Clause
- Copyright (c) 2018 Kyle Evans <kevans@FreeBSD.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms