Vertical Alignment & Complete Colors
In this latest release of Lip Gloss, styles now support vertical alignment for all your vertical alignment needs! Additionally, CompleteColor
and CompleteAdaptiveColor
was introduced.
Align content in a Style
vertically at the top, center, or bottom. To get started make a style with some Height
and an AlignVertical
property.
lipgloss.NewStyle().Height(5).AlignVertical(lipgloss.Center).Render("Hello, Center!")
or use the Align
shorthand which sets both horizontal and vertical alignments:
lipgloss.NewStyle().Height(5).Align(lipgloss.Left, lipgloss.Bottom).Render("Hello, Center!")
New API:
Note, there are no breaking changes since if the
Align
shorthand will still accept 1 argument (variadic arguments) and will set only the horizontal alignment to maintain original functionality
Align(p ...Position)
AlignVertical(p Position)
AlignHorizontal(p Position)
GetAlignVertical() Position
GetAlignHorizontal() Position
Complete Colors
This revision introduces two new color types CompleteColor
and CompleteAdaptiveColor
. Not for the faint of heart, these types are for bypassing automatic color interpolation so you can specify exact colors for all color profiles:
cc := CompleteColor{
TrueColor: "#6B51FF",
ANSI256: "63",
ANSI: "5",
}
cac := CompleteAdaptiveColor{
Light: CompleteColor{
TrueColor: "#FF51CE",
ANSI256: "213",
ANSI: "5",
},
Dark: CompleteColor{
TrueColor: "#6B51FF",
ANSI256: "63",
ANSI: "5",
},
}
New
- Non-Interpolated Colors by @meowgorithm in #100
- Vertical Alignment by @maaslalani in #106
Fixed
- Protect against concurrent color profile access with a
sync.RWMutex
by @meowgorithm in #68 - don't overwrite background when inheriting by @76creates in #69
New Contributors
- @Evertras made their first contribution in #71
- @ismaelpadilla made their first contribution in #94
- @mark2185 made their first contribution in #103
- @inkel made their first contribution in #107
Full Changelog: v0.5.0...v0.6.0
Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or Slack.