Repository navigation
v2.2.0-alpha.1
Pre-release
Pre-release
·
4 commits
to master
since this release
Highlights
Roles return Lip Gloss styles
The roles module now hands back Lip Gloss styles, so styling from a role no longer needs glue code in every app. Each style carries the attribute that stands in for a color where the terminal can't draw it, such as faint for muted text at 16 colors, or reverse for the selection with no color at all.
f := roles.Derive(tint.Current()).Fit(roles.Target{Profile: msg.Profile}) // tea.ColorProfileMsg
hint := f.Text(roles.Subtle) // text in a role's color
pill := f.Fill(roles.Danger) // a solid tone, with the text that reads on it
soft := f.Fill(roles.Danger.Soft()) // a faded tone, with the tone as text
// Text on a surface is kept readable there, and drawn on the surface's color.
dialog := f.Fill(roles.Raised)
note := f.On(roles.Raised).Text(roles.Muted)f.On(surface) is worked out once per surface, so it's cheap to call while rendering.
Upgrading from v2.2.0-alpha.0
roles.Target{Depth: roles.DepthOf(p)}is nowroles.Target{Profile: p}, taking acolorprofile.Profiledirectly.Depth, its constants,DepthOfandFitted.Depthare gone.Palette.Tone,Guarded,Mono,AccentSlotandAccent2Slotare removed. Usep.Color(r),p.Color(r.Soft())andp.Color(r.On())in place ofTone.
The complex and load-from-file examples now style from roles, which keeps their buttons readable on every tint:
Changelog
⚠️ Breaking Changes
- b7e54cd: roles: style with Lip Gloss, and draw text on surfaces with On (@lrstanley)
- Target.Depth, Depth, DepthOf, Fitted.Depth, Palette.Tone, Tone, Palette.Guarded, Palette.Mono, Palette.AccentSlot and Palette.Accent2Slot are removed. Use Target.Profile with a colorprofile.Profile.
📚 Documentation
- a09b536: examples: record the demos with reel, as webp (@lrstanley)
🧹 Misc
1 change
- 676aa95: examples: move to v2.2.0-alpha.0 (@lrstanley)
Full changelog: v2.2.0-alpha.0...v2.2.0-alpha.1
📦 Install
go get github.com/lrstanley/bubbletint/chromatint/v2@v2.2.0-alpha.1
go get github.com/lrstanley/bubbletint/glamourtint/v2@v2.2.0-alpha.1
go get github.com/lrstanley/bubbletint/roles/v2@v2.2.0-alpha.1
go get github.com/lrstanley/bubbletint/sources/v2@v2.2.0-alpha.1
go get github.com/lrstanley/bubbletint/v2@v2.2.0-alpha.1Docs:
- github.com/lrstanley/bubbletint/chromatint/v2
- github.com/lrstanley/bubbletint/glamourtint/v2
- github.com/lrstanley/bubbletint/roles/v2
- github.com/lrstanley/bubbletint/sources/v2
- github.com/lrstanley/bubbletint/v2
💬 What to do next?
- 🙋♂️ Running into an issue or want a specific feature? Take a look here!
- ⌚ Find previous releases.
- 🔗 Other useful links:
