LipGloss

Wrapper for lipgloss library.


Source: pkg/lua/lib/lipgloss.go | Import: lipgloss

Functions


has_dark_background

has_dark_background() -> bool

Return Values

  • bool
size

size(str) -> int, int

Arguments

  • str string - The string to measure.
Return Values

  • int - The width of the string.
  • int - The height of the string.
width

width(str) -> int

Arguments

  • str string - The string to measure.
Return Values

  • int - The width of the string.
height

height(str) -> int

Arguments

  • str string - The string to measure.
Return Values

  • int - The height of the string.
join_horizontal

join_horizontal(pos, str...) -> string

Arguments

  • pos float<lipgloss.Position> - Percentage between 0 and 1.
  • str string... - The strings to join.
Return Values

  • string - The joined string.
join_vertical

join_vertical(pos, str...) -> string

Arguments

  • pos float<lipgloss.Position> - Percentage between 0 and 1.
  • str string... - The strings to join.
Return Values

  • string - The joined string.
color

color(col) -> struct<lipgloss.Color>

Arguments

  • col string
Return Values

  • struct<lipgloss.Color>
color_rgb

color_rgb(col) -> struct<lipgloss.Color>

Arguments

  • col struct<image.Color>
Return Values

  • struct<lipgloss.Color>
color_none

color_none() -> struct<lipgloss.ColorNone>

Return Values

  • struct<lipgloss.ColorNone>
color_ansi

color_ansi(col) -> struct<lipgloss.ColorAnsi>

Arguments

  • col int
Return Values

  • struct<lipgloss.Color>
color_adaptive

color_adaptive(light, dark) -> struct<lipgloss.ColorAdaptive>

Arguments

  • light string
  • dark string
Return Values

  • struct<lipgloss.ColorAdaptive>
color_adaptive_rgb

color_adaptive_rgb(light, dark) -> struct<lipgloss.ColorAdaptive>

Arguments

  • light struct<image.Color>
  • dark struct<image.Color>
Return Values

  • struct<lipgloss.ColorAdaptive>
color_complete

color_complete(truecolor, ansi256, ansi) -> struct<lipgloss.ColorComplete>

Arguments

  • truecolor string
  • ansi256 string
  • ansi string
Return Values

  • struct<lipgloss.ColorComplete>
color_complete_adaptive

color_complete_adaptive(light, dark) -> struct<lipgloss.ColorCompleteAdaptive>

Arguments

  • light struct<lipgloss.ColorComplete>
  • dark struct<lipgloss.ColorComplete>
Return Values

  • struct<lipgloss.ColorCompleteAdaptive>
border

border(top, bottom, left, right, topleft, topright, bottomleft, bottomright, middleleft, middleright, middle, middletop, middlebottom) -> struct<lipgloss.Border>

Arguments

  • top string
  • bottom string
  • left string
  • right string
  • topleft string
  • topright string
  • bottomleft string
  • bottomright string
  • middleleft string
  • middleright string
  • middle string
  • middletop string
  • middlebottom string
Return Values

  • struct<lipgloss.Border>
border_block

border_block() -> struct<lipgloss.Border>

Return Values

  • struct<lipgloss.Border>
border_double

border_double() -> struct<lipgloss.Border>

Return Values

  • struct<lipgloss.Border>
border_hidden

border_hidden() -> struct<lipgloss.Border>

Return Values

  • struct<lipgloss.Border>
border_block_inner_half

border_block_inner_half() -> struct<lipgloss.Border>

Return Values

  • struct<lipgloss.Border>
border_normal

border_normal() -> struct<lipgloss.Border>

Return Values

  • struct<lipgloss.Border>
border_block_outer_half

border_block_outer_half() -> struct<lipgloss.Border>

Return Values

  • struct<lipgloss.Border>
border_rounded

border_rounded() -> struct<lipgloss.Border>

Return Values

  • struct<lipgloss.Border>
border_thick

border_thick() -> struct<lipgloss.Border>

Return Values

  • struct<lipgloss.Border>
whitespace_option

whitespace_option() -> struct<lipgloss.WhitespaceOption>

Return Values

  • struct<lipgloss.WhitespaceOption>
place

place(width, height, hpos, vpos, str, opts?) -> string

Arguments

  • width int
  • height int
  • hpos float<lipgloss.Position>
  • vpos float<lipgloss.Position>
  • str string
  • opts struct<lipgloss.WhitespaceOption>
Return Values

  • string
place_horizontal

place_horizontal(width, hpos, str, opts?) -> string

Arguments

  • width int
  • hpos float<lipgloss.Position>
  • str string
  • opts struct<lipgloss.WhitespaceOption>
Return Values

  • string
place_vertical

place_vertical(height, vpos, str, opts?) -> string

Arguments

  • height int
  • vpos float<lipgloss.Position>
  • str string
  • opts struct<lipgloss.WhitespaceOption>
Return Values

  • string
style

style() -> struct<lipgloss.Style>

Return Values

  • struct<lipgloss.Style>
style_delete

style_delete(style)

Arguments

  • style struct<lipgloss.Style>
style_runes

style_runes(str, indices, match, unmatch) -> string

Arguments

  • str string
  • indices []int
  • match struct<lipgloss.Style>
  • unmatch struct<lipgloss.Style>
Return Values

  • string
style_string

style_string(str, style) -> string

Arguments

  • str string
  • style struct<lipgloss.Style>
Return Values

  • string

Constants


Position
  • POSITION_TOP
  • POSITION_BOTTOM
  • POSITION_CENTER
  • POSITION_LEFT
  • POSITION_RIGHT
ColorType
  • COLOR
  • COLOR_NONE
  • COLOR_ANSI
  • COLOR_ADAPTIVE
  • COLOR_COMPLETE
  • COLOR_COMPLETEADAPTIVE
Special
  • NOTAB_CONVERSION

Structs


Color

Properties

  • type int<lipgloss.ColorType> - The type of color.
  • value string - The color value.
ColorNone

Properties

  • type int<lipgloss.ColorType> - The type of color.
ColorAnsi

Properties

  • type int<lipgloss.ColorType> - The type of color.
  • value int - The color value.
ColorAdaptive

Properties

  • type int<lipgloss.ColorType> - The type of color.
  • light string - The color value for light backgrounds.
  • dark string - The color value for dark backgrounds.
ColorComplete

Properties

  • type int<lipgloss.ColorType> - The type of color.
  • truecolor string
  • ansi256 string
  • ansi string
ColorCompleteAdaptive

Properties

  • type int<lipgloss.ColorType> - The type of color.
  • light struct<lipgloss.ColorComplete>
  • dark struct<lipgloss.ColorComplete>
Border

Properties

  • top string
  • bottom string
  • left string
  • right string
  • topleft string
  • topright string
  • bottomleft string
  • bottomright string
  • middleleft string
  • middleright string
  • middle string
  • middletop string
  • middlebottom string
Methods

size_top

size_top() -> int

size_bottom

size_bottom() -> int

size_left

size_left() -> int

size_right

size_right() -> int

WhitespaceOption

Methods

foreground

foreground(self, color struct<lipgloss.ColorAny>) -> self

background

background(self, color struct<lipgloss.ColorAny>) -> self

chars

chars(self, string) -> self

Style

Properties

  • id int<collection.CRATE_LIPGLOSS> - The ID of the style.
Methods

render

render(string...) -> string

align

align() -> float<lipgloss.Position>, float<lipgloss.Position>

align_set

align_set(self, hpos float<lipgloss.Position>, vpos float<lipgloss.Position>) -> self

align_unset

align_unset(self) -> self

align_horizontal

align_horizontal() -> float<lipgloss.Position>

align_horizontal_set

align_horizontal_set(self, hpos float<lipgloss.Position>) -> self

align_horizontal_unset

align_horizontal_unset(self) -> self

align_vertical

align_vertical() -> float<lipgloss.Position>

align_vertical_set

align_vertical_set(self, vpos float<lipgloss.Position>) -> self

align_vertical_unset

align_vertical_unset(self) -> self

blink

blink() -> bool

blink_set

blink_set(self, enabled bool) -> self

blink_unset

blink_unset(self) -> self

bold

bold() -> bool

bold_set

bold_set(self, enabled bool) -> self

bold_unset

bold_unset(self) -> self

faint

faint() -> bool

faint_set

faint_set(self, enabled bool) -> self

faint_unset

faint_unset(self) -> self

italic

italic() -> bool

italic_set

italic_set(self, enabled bool) -> self

italic_unset

italic_unset(self) -> self

underline

underline() -> bool

underline_set

underline_set(self, enabled bool) -> self

underline_unset

underline_unset(self) -> self

underline_spaces

underline_spaces() -> bool

underline_spaces_set

underline_spaces_set(self, enabled bool) -> self

underline_spaces_unset

underline_spaces_unset(self) -> self

strikethrough

strikethrough() -> bool

strikethrough_set

strikethrough_set(self, enabled bool) -> self

strikethrough_unset

strikethrough_unset(self) -> self

strikethrough_spaces

strikethrough_spaces() -> bool

strikethrough_spaces_set

strikethrough_spaces_set(self, enabled bool) -> self

strikethrough_spaces_unset

strikethrough_spaces_unset(self) -> self

reverse

reverse() -> bool

reverse_set

reverse_set(self, enabled bool) -> self

reverse_unset

reverse_unset(self) -> self

foreground

foreground() -> struct<lipgloss.ColorAny>

foreground_set

foreground_set(self, color struct<lipgloss.ColorAny>) -> self

foreground_unset

foreground_unset(self) -> self

background

background() -> struct<lipgloss.ColorAny>

background_set

background_set(self, color struct<lipgloss.ColorAny>) -> self

background_unset

background_unset(self) -> self

inline

inline() -> bool

inline_set

inline_set(self, enabled bool) -> self

inline_unset

inline_unset(self) -> self

width

width() -> int

width_set

width_set(self, width int) -> self

width_unset

width_unset(self) -> self

height

height() -> int

height_set

height_set(self, height int) -> self

height_unset

height_unset(self) -> self

width_max

width_max() -> int

width_max_set

width_max_set(self, width int) -> self

width_max_unset

width_max_unset(self) -> self

height_max

height_max() -> int

height_max_set

height_max_set(self, height int) -> self

height_max_unset

height_max_unset(self) -> self

tab_width

tab_width() -> int

tab_width_set

tab_width_set(self, width int) -> self

tab_width_unset

tab_width_unset(self) -> self

border

border() -> struct<lipgloss.Border>, bool, bool, bool, bool

border_set

border_set(self, border struct<lipgloss.Border>, sides bool...) -> self

border_unset

border_unset(self) -> self

border_foreground_set

border_foreground_set(self, color struct<lipgloss.ColorAny>...) -> self

border_background_set

border_background_set(self, color struct<lipgloss.ColorAny>...) -> self

border_style

border_style() -> struct<lipgloss.Border>

border_style_set

border_style_set(self, border struct<lipgloss.Border>) -> self

border_style_unset

border_style_unset(self) -> self

border_top

border_top() -> bool

border_top_set

border_top_set(self, enabled bool) -> self

border_top_unset

border_top_unset(self) -> self

border_top_foreground

border_top_foreground() -> struct<lipgloss.ColorAny>

border_top_foreground_set

border_top_foreground_set(self, color struct<lipgloss.ColorAny>) -> self

border_top_foreground_unset

border_top_foreground_unset(self) -> self

border_top_background

border_top_background() -> struct<lipgloss.ColorAny>

border_top_background_set

border_top_background_set(self, color struct<lipgloss.ColorAny>) -> self

border_top_background_unset

border_top_background_unset(self) -> self

border_bottom

border_bottom() -> bool

border_bottom_set

border_bottom_set(self, enabled bool) -> self

border_bottom_unset

border_bottom_unset(self) -> self

border_bottom_foreground

border_bottom_foreground() -> struct<lipgloss.ColorAny>

border_bottom_foreground_set

border_bottom_foreground_set(self, color struct<lipgloss.ColorAny>) -> self

border_bottom_foreground_unset

border_bottom_foreground_unset(self) -> self

border_bottom_background

border_bottom_background() -> struct<lipgloss.ColorAny>

border_bottom_background_set

border_bottom_background_set(self, color struct<lipgloss.ColorAny>) -> self

border_bottom_background_unset

border_bottom_background_unset(self) -> self

border_left

border_left() -> bool

border_left_set

border_left_set(self, enabled bool) -> self

border_left_unset

border_left_unset(self) -> self

border_left_foreground

border_left_foreground() -> struct<lipgloss.ColorAny>

border_left_foreground_set

border_left_foreground_set(self, color struct<lipgloss.ColorAny>) -> self

border_left_foreground_unset

border_left_foreground_unset(self) -> self

border_left_background

border_left_background() -> struct<lipgloss.ColorAny>

border_left_background_set

border_left_background_set(self, color struct<lipgloss.ColorAny>) -> self

border_left_background_unset

border_left_background_unset(self) -> self

border_right

border_right() -> bool

border_right_set

border_right_set(self, enabled bool) -> self

border_right_unset

border_right_unset(self) -> self

border_right_foreground

border_right_foreground() -> struct<lipgloss.ColorAny>

border_right_foreground_set

border_right_foreground_set(self, color struct<lipgloss.ColorAny>) -> self

border_right_foreground_unset

border_right_foreground_unset(self) -> self

border_right_background

border_right_background() -> struct<lipgloss.ColorAny>

border_right_background_set

border_right_background_set(self, color struct<lipgloss.ColorAny>) -> self

border_right_background_unset

border_right_background_unset(self) -> self

margin

margin() -> int, int, int, int

margin_set

margin_set(self, sides int...) -> self

margin_unset

margin_unset(self) -> self

margin_top

margin_top() -> int

margin_top_set

margin_top_set(self, size int) -> self

margin_top_unset

margin_top_unset(self) -> self

margin_bottom

margin_bottom() -> int

margin_bottom_set

margin_bottom_set(self, size int) -> self

margin_bottom_unset

margin_bottom_unset(self) -> self

margin_left

margin_left() -> int

margin_left_set

margin_left_set(self, size int) -> self

margin_left_unset

margin_left_unset(self) -> self

margin_right

margin_right() -> int

margin_right_set

margin_right_set(self, size int) -> self

margin_right_unset

margin_right_unset(self) -> self

margin_background_set

margin_background_set(self, color struct<lipgloss.ColorAny>) -> self

margin_background_unset

margin_background_unset(self) -> self

padding

padding() -> int, int, int, int

padding_set

padding_set(self, sides int...) -> self

padding_unset

padding_unset(self) -> self

padding_top

padding_top() -> int

padding_top_set

padding_top_set(self, size int) -> self

padding_top_unset

padding_top_unset(self) -> self

padding_bottom

padding_bottom() -> int

padding_bottom_set

padding_bottom_set(self, size int) -> self

padding_bottom_unset

padding_bottom_unset(self) -> self

padding_left

padding_left() -> int

padding_left_set

padding_left_set(self, size int) -> self

padding_left_unset

padding_left_unset(self) -> self

padding_right

padding_right() -> int

padding_right_set

padding_right_set(self, size int) -> self

padding_right_unset

padding_right_unset(self) -> self

transform_set

transform_set(self, transform func(string) -> string) -> self

transform_unset

transform_unset(self) -> self

Interfaces


ColorAny

Properties

  • type int<lipgloss.ColorType> - The type of color.