2 .\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD
4 .\" Copyright (c) 2018 Kyle Evans <kevans@FreeBSD.org>
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
15 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 .Nd FreeBSD color module
37 contains functionality for working with colors.
39 Before using the functionality provided by
41 it must be included with a statement such as the following:
43 .Dl local color = require("color")
45 The following color constants are exported from
47 .Bl -tag -width "Ic color.MAGENTA" -offset indent
58 The following attribute constants are exported from
60 .Bl -tag -width "Ic color.DEFAULT" -offset indent
66 The following functions are exported from
68 .Bl -tag -width "Fn color.isEnabled" -offset indent
69 .It Fn color.isEnabled
72 has been configured to not allow color, False otherwise.
77 .Fn core.isSerialBoot .
78 .It Fn color.escapefg color_value
79 Returns the escape sequence that encodes
81 as a foreground color.
83 returns an empty string if color is disabled.
85 Returns the escape sequence for the default foreground color.
87 returns an empty string if color is disabled.
88 .It Fn color.escapebg color_value
89 Returns the escape sequence that encodes
91 as a background color.
93 returns an empty string if color is disabled.
95 Returns the escape sequence for the default background color.
97 returns an empty string if color is disabled.
98 .It Fn color.escape fg_color bg_color attribute
99 Returns an escape sequence that encodes
101 as the foreground color,
103 as the background color, and
107 returns an empty string if color is disabled.
109 Returns the escape sequence for the default color scheme, white on black with
110 no attributes applied.
112 returns an empty string if color is disabled.
113 .It Fn color.highlight str
118 attribute applied before it and reset after it.
122 if color is disabled.
129 file was originally written by
130 .An Pedro Souza Aq Mt pedrosouza@FreeBSD.org .
131 Later work and this manual page was done by
132 .An Kyle Evans Aq Mt kevans@FreeBSD.org .