colors

package
v5.28.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 8, 2024 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Header   = &unison.ThemeColor{Light: unison.RGB(80, 80, 80), Dark: unison.RGB(64, 64, 64)}
	OnHeader = Header.DeriveOn()
)

Additional theme colors

Functions

This section is empty.

Types

type Colors

type Colors struct {
	// contains filtered or unexported fields
}

Colors holds a set of themed colors.

func NewFromFS

func NewFromFS(fileSystem fs.FS, filePath string) (*Colors, error)

NewFromFS creates a new set of colors from a file. Any missing values will be filled in with defaults.

func (*Colors) MakeCurrent

func (c *Colors) MakeCurrent()

MakeCurrent applies these colors to the current theme color set and updates all windows.

func (*Colors) MarshalJSON

func (c *Colors) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*Colors) Reset

func (c *Colors) Reset()

Reset to factory defaults.

func (*Colors) ResetOne

func (c *Colors) ResetOne(id string)

ResetOne resets one color by ID to factory defaults.

func (*Colors) Save

func (c *Colors) Save(filePath string) error

Save writes the Colors to the file as JSON.

func (*Colors) UnmarshalJSON

func (c *Colors) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ThemedColor

type ThemedColor struct {
	ID    string
	Title string
	Color *unison.ThemeColor
}

ThemedColor holds a themed color.

func Current

func Current() []*ThemedColor

Current returns the current theme.

func Factory

func Factory() []*ThemedColor

Factory returns the original theme before any modifications.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL