Repository navigation
v2.2.0-alpha.6
Pre-release
Pre-release
·
3 commits
to master
since this release
Highlights
-
roles:
Fitted.Scanfills a struct of your own fromrolestruct tags. A package that can't import roles can declare its palette, and get roles' derivation, contrast guards and fitting for every ground without importing it. Each swatch holds whatTextorFillwould draw: aColorand theAttrbits that stand in for it.type Swatch struct { Color color.Color Attr uint8 } type Palette struct { Muted Swatch `role:"muted"` Hover Swatch `role:"ground:hover"` OnDanger Swatch `role:"fg@danger"` // body text on a danger fill Dialog struct { Muted Swatch `role:"muted"` } `role:"@raised"` // drawn on a dialog } var p Palette err := roles.Derive(t).Fit(target).Scan(&p)
Unknown roles and states are errors, so a typo doesn't leave a color unset.
Changelog
✨ New Features
- 52c6cee: roles: fill a struct of swatches from role tags (@lrstanley)
Full changelog: v2.2.0-alpha.5...v2.2.0-alpha.6
📦 Install
go get github.com/lrstanley/bubbletint/chromatint/v2@v2.2.0-alpha.6
go get github.com/lrstanley/bubbletint/glamourtint/v2@v2.2.0-alpha.6
go get github.com/lrstanley/bubbletint/roles/v2@v2.2.0-alpha.6
go get github.com/lrstanley/bubbletint/sources/v2@v2.2.0-alpha.6
go get github.com/lrstanley/bubbletint/v2@v2.2.0-alpha.6Docs:
- 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: