Bubbletint Save

Terminal tints for everyone

Project README

:sparkles: Features

  • :heavy_check_mark: Utilize 280+ built-in tints. Check them all out here! We're taking advantage of the great work others have done with Windows Terminal Themes and iTerm2-Color-Schemes, and making them more accessible in a programmatic fashion.
  • :heavy_check_mark: Support for dynamically changing tints at runtime, to give immediate feedback on which tints might look the best for your application and terminal setup.
  • :heavy_check_mark: Piecemeal support for specific tints. Really like one specific tint, and want to use that as the standard for your TUI? No problem!
  • :heavy_check_mark: Extendible via interfaces. Easily create custom tints.
  • :heavy_check_mark: Works with lipgloss and similar tools which support the color.Color interface from stdlib!

:gear: Usage

go get -u github.com/lrstanley/bubbletint@latest

Take a look at all tints here.

BubbleTint supports three different modes of usage, as shown below:

Global registry

package main

import (
	// [...]
	tint "github.com/lrstanley/bubbletint"
)


func main() {
	// [...]
	tint.NewDefaultRegistry()
	tint.SetTint(tint.TintDraculaPlus) // Set a specific tint.
	tint.SetTintID("dracula_plus") // Or by ID (this aligns with a Tint's ID() method).

	// You can now use methods like tint.Bg(), tint.Fg(), tint.BrightGreen(), etc.
	style := lipgloss.NewStyle().SetForeground(tint.Fg()).Background(tint.BrightGreen())
}

Custom Registry

package main

import (
	// [...]
	tint "github.com/lrstanley/bubbletint"
)


func main() {
	// [...]
	theme := tint.NewRegistry(
		tint.TintDraculaPlus, // Set default/current tint.
		tint.TintGithub,
		tint.TintTomorrow,
		tint.TintTokyoNight,
	}

	theme.Register(tint.TintNord) // Register additional tints on the custom registry.
	theme.SetTint(tint.TintNord) // Can still set a tint on a custom registry.

	// Can also paginate through tints, using PreviousTint/NextTint
	theme.NextTint()

	// You can now use methods like theme.Bg(), theme.Fg(), theme.BrightGreen(), etc.
	style := lipgloss.NewStyle().SetForeground(theme.Fg()).Background(theme.BrightGreen())
}

Use specific tints

package main

import (
	// [...]
	tint "github.com/lrstanley/bubbletint"
)

var (
	statusbarStyle = lipgloss.NewStyle().
		SetForeground(tint.TintDraculaPlus.Fg()).
		Background(tint.TintDraculaPlus.BrightGreen())
)

// Or:
var (
	theme = tint.TintDraculaPlus
	statusbarStyle = lipgloss.NewStyle().SetForeground(theme.Fg()).Background(theme.BrightGreen())
)

... and that's it!


:clap: Examples

Package manager example

  • Uses a static theme with a specific palette for the entire application.
  • Example source.

package-manager example

Complex example

  • Uses the default registry (with all tints), and has keybinds to paginate through each tint.
  • Note that only a portion of this example is styled (e.g. not a full background color, which may make sense for some of the provided tints).
  • Example source.

complex example


:raising_hand_man: Support & Assistance

  • :heart: Please review the Code of Conduct for guidelines on ensuring everyone has the best experience interacting with the community.
  • :raising_hand_man: Take a look at the support document on guidelines for tips on how to ask the right questions.
  • :lady_beetle: For all features/bugs/issues/questions/etc, head over here.

:handshake: Contributing

  • :heart: Please review the Code of Conduct for guidelines on ensuring everyone has the best experience interacting with the community.
  • :clipboard: Please review the contributing doc for submitting issues/a guide on submitting pull requests and helping out.
  • :old_key: For anything security related, please review this repositories security policy.

:balance_scale: License

MIT License

Copyright (c) 2022 Liam Stanley <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Also located here

Open Source Agenda is not affiliated with "Bubbletint" Project. README Source: lrstanley/bubbletint
Stars
70
Open Issues
3
Last Commit
3 months ago
License
MIT

Open Source Agenda Badge

Open Source Agenda Rating