pub struct Form {
pub style: ContentStyle,
/* private fields */
}Expand description
A style for text.
Fields§
§style: ContentStyleThe actual style that is applied
Implementations§
Source§impl Form
impl Form
Sourcepub const fn underlined(self) -> Form
pub const fn underlined(self) -> Form
New Form with the
underlined
attribute.
Sourcepub const fn double_underlined(self) -> Form
pub const fn double_underlined(self) -> Form
New Form with the
double_underlined
attribute.
Sourcepub const fn undercurled(self) -> Form
pub const fn undercurled(self) -> Form
New Form with the
undercurled
attribute.
Sourcepub const fn underdashed(self) -> Form
pub const fn underdashed(self) -> Form
New Form with the
underdashed
attribute.
Sourcepub const fn crossed_out(self) -> Form
pub const fn crossed_out(self) -> Form
New Form with the
crossed_out
attribute.
Sourcepub const fn underline_black(self) -> Form
pub const fn underline_black(self) -> Form
New Form with a
black
underlining.
Do note that this feature may not be supported in all Uis,
for example, various terminals don’t support this feature,
since it is a part of the kitty protocol, and hasn’t been
universally accepted yet.
Ui: crate::ui::traits::RawUi
Sourcepub const fn on_dark_grey(self) -> Form
pub const fn on_dark_grey(self) -> Form
New Form with a
dark_grey
background.
Sourcepub const fn underline_dark_grey(self) -> Form
pub const fn underline_dark_grey(self) -> Form
New Form with a
dark_grey
underlining.
Do note that this feature may not be supported in all Uis,
for example, various terminals don’t support this feature,
since it is a part of the kitty protocol, and hasn’t been
universally accepted yet.
Ui: crate::ui::traits::RawUi
Sourcepub const fn underline_red(self) -> Form
pub const fn underline_red(self) -> Form
New Form with a
red
underlining.
Do note that this feature may not be supported in all Uis,
for example, various terminals don’t support this feature,
since it is a part of the kitty protocol, and hasn’t been
universally accepted yet.
Ui: crate::ui::traits::RawUi
Sourcepub const fn on_dark_red(self) -> Form
pub const fn on_dark_red(self) -> Form
New Form with a
dark_red
background.
Sourcepub const fn underline_dark_red(self) -> Form
pub const fn underline_dark_red(self) -> Form
New Form with a
dark_red
underlining.
Do note that this feature may not be supported in all Uis,
for example, various terminals don’t support this feature,
since it is a part of the kitty protocol, and hasn’t been
universally accepted yet.
Ui: crate::ui::traits::RawUi
Sourcepub const fn underline_green(self) -> Form
pub const fn underline_green(self) -> Form
New Form with a
green
underlining.
Do note that this feature may not be supported in all Uis,
for example, various terminals don’t support this feature,
since it is a part of the kitty protocol, and hasn’t been
universally accepted yet.
Ui: crate::ui::traits::RawUi
Sourcepub const fn dark_green(self) -> Form
pub const fn dark_green(self) -> Form
New Form with a
dark_green
foreground.
Sourcepub const fn on_dark_green(self) -> Form
pub const fn on_dark_green(self) -> Form
New Form with a
dark_green
background.
Sourcepub const fn underline_dark_green(self) -> Form
pub const fn underline_dark_green(self) -> Form
New Form with a
dark_green
underlining.
Do note that this feature may not be supported in all Uis,
for example, various terminals don’t support this feature,
since it is a part of the kitty protocol, and hasn’t been
universally accepted yet.
Ui: crate::ui::traits::RawUi
Sourcepub const fn underline_yellow(self) -> Form
pub const fn underline_yellow(self) -> Form
New Form with a
yellow
underlining.
Do note that this feature may not be supported in all Uis,
for example, various terminals don’t support this feature,
since it is a part of the kitty protocol, and hasn’t been
universally accepted yet.
Ui: crate::ui::traits::RawUi
Sourcepub const fn dark_yellow(self) -> Form
pub const fn dark_yellow(self) -> Form
New Form with a
dark_yellow
foreground.
Sourcepub const fn on_dark_yellow(self) -> Form
pub const fn on_dark_yellow(self) -> Form
New Form with a
dark_yellow
background.
Sourcepub const fn underline_dark_yellow(self) -> Form
pub const fn underline_dark_yellow(self) -> Form
New Form with a
dark_yellow
underlining.
Do note that this feature may not be supported in all Uis,
for example, various terminals don’t support this feature,
since it is a part of the kitty protocol, and hasn’t been
universally accepted yet.
Ui: crate::ui::traits::RawUi
Sourcepub const fn underline_blue(self) -> Form
pub const fn underline_blue(self) -> Form
New Form with a
blue
underlining.
Do note that this feature may not be supported in all Uis,
for example, various terminals don’t support this feature,
since it is a part of the kitty protocol, and hasn’t been
universally accepted yet.
Ui: crate::ui::traits::RawUi
Sourcepub const fn on_dark_blue(self) -> Form
pub const fn on_dark_blue(self) -> Form
New Form with a
dark_blue
background.
Sourcepub const fn underline_dark_blue(self) -> Form
pub const fn underline_dark_blue(self) -> Form
New Form with a
dark_blue
underlining.
Do note that this feature may not be supported in all Uis,
for example, various terminals don’t support this feature,
since it is a part of the kitty protocol, and hasn’t been
universally accepted yet.
Ui: crate::ui::traits::RawUi
Sourcepub const fn on_magenta(self) -> Form
pub const fn on_magenta(self) -> Form
New Form with a
magenta
background.
Sourcepub const fn underline_magenta(self) -> Form
pub const fn underline_magenta(self) -> Form
New Form with a
magenta
underlining.
Do note that this feature may not be supported in all Uis,
for example, various terminals don’t support this feature,
since it is a part of the kitty protocol, and hasn’t been
universally accepted yet.
Ui: crate::ui::traits::RawUi
Sourcepub const fn dark_magenta(self) -> Form
pub const fn dark_magenta(self) -> Form
New Form with a
dark_magenta
foreground.
Sourcepub const fn on_dark_magenta(self) -> Form
pub const fn on_dark_magenta(self) -> Form
New Form with a
dark_magenta
background.
Sourcepub const fn underline_dark_magenta(self) -> Form
pub const fn underline_dark_magenta(self) -> Form
New Form with a
dark_magenta
underlining.
Do note that this feature may not be supported in all Uis,
for example, various terminals don’t support this feature,
since it is a part of the kitty protocol, and hasn’t been
universally accepted yet.
Ui: crate::ui::traits::RawUi
Sourcepub const fn underline_cyan(self) -> Form
pub const fn underline_cyan(self) -> Form
New Form with a
cyan
underlining.
Do note that this feature may not be supported in all Uis,
for example, various terminals don’t support this feature,
since it is a part of the kitty protocol, and hasn’t been
universally accepted yet.
Ui: crate::ui::traits::RawUi
Sourcepub const fn on_dark_cyan(self) -> Form
pub const fn on_dark_cyan(self) -> Form
New Form with a
dark_cyan
background.
Sourcepub const fn underline_dark_cyan(self) -> Form
pub const fn underline_dark_cyan(self) -> Form
New Form with a
dark_cyan
underlining.
Do note that this feature may not be supported in all Uis,
for example, various terminals don’t support this feature,
since it is a part of the kitty protocol, and hasn’t been
universally accepted yet.
Ui: crate::ui::traits::RawUi
Sourcepub const fn underline_white(self) -> Form
pub const fn underline_white(self) -> Form
New Form with a
white
underlining.
Do note that this feature may not be supported in all Uis,
for example, various terminals don’t support this feature,
since it is a part of the kitty protocol, and hasn’t been
universally accepted yet.
Ui: crate::ui::traits::RawUi
Sourcepub const fn underline_grey(self) -> Form
pub const fn underline_grey(self) -> Form
New Form with a
grey
underlining.
Do note that this feature may not be supported in all Uis,
for example, various terminals don’t support this feature,
since it is a part of the kitty protocol, and hasn’t been
universally accepted yet.
Ui: crate::ui::traits::RawUi
Source§impl Form
impl Form
Sourcepub fn mimic(form_name: impl AsRef<str>) -> Form
pub fn mimic(form_name: impl AsRef<str>) -> Form
A Form that mimics another.
This is useful if you want Forms to automatically change if
the mimicked one does.
Normally, this is done automatically. For example, if you
define a Form “foo.bar.baz” through form::id_of!, or
within the txt! macro, then that Form will be set to
“mimic” “foo.bar”. That is, if “foo.bar” changes, so will
“foo.bar.baz”.
This function lets you manually do that.
Sourcepub const fn with(self, color: &str) -> Form
pub const fn with(self, color: &str) -> Form
Sets the color of the foreground.
This function accepts two color formats:
- A hexcode, like
"#abcdef", capitalization is ignored; - Three hsl values, like
"hsl {hue} {sat} {lit}", where {hue}, {sat} and {lit} can either be a number from0..255, or a percentage, followed by'%', e.g."hsl 234 50% 42".
If this Form was created via Form::mimic, then the other
attributes will change as the mimicked color does, but the
foreground won’t.
Sourcepub const fn on(self, color: &str) -> Form
pub const fn on(self, color: &str) -> Form
New Form with a colored background.
This function accepts two color formats:
- A hexcode, like
"#abcdef", capitalization is ignored; - Three hsl values, like
"hsl {hue} {sat} {lit}", where {hue}, {sat} and {lit} can either be a number from0..255, or a percentage, followed by'%', e.g."hsl 234 50% 42".
If this Form was created via Form::mimic, then the other
attributes will change as the mimicked color does, but the
background won’t.
Sourcepub fn underline(self, color: &str) -> Form
pub fn underline(self, color: &str) -> Form
New Form with a colored underline..
Note that this doesn’t actually make the underline show up, it
merely colors one that is set via a command like
Form::underlined.
This function accepts two color formats:
- A hexcode, like
"#abcdef", capitalization is ignored; - Three hsl values, like
"hsl {hue} {sat} {lit}", where {hue}, {sat} and {lit} can either be a number from0..255, or a percentage, followed by'%', e.g."hsl 234 50% 42".
If this Form was created via Form::mimic, then the other
attributes will change as the mimicked color does, but the
underline color won’t.