Documentation
¶
Index ¶
- Constants
- Variables
- func SelectColors(colors []color.Hct, k int) []color.Hct
- type Base16
- func (b *Base16) SetBlack(c color.Hct)
- func (b *Base16) SetBlue(c color.Hct)
- func (b *Base16) SetCyan(c color.Hct)
- func (b *Base16) SetGreen(c color.Hct)
- func (b *Base16) SetMagenta(c color.Hct)
- func (b *Base16) SetRed(c color.Hct)
- func (b *Base16) SetWhite(c color.Hct)
- func (b *Base16) SetYellow(c color.Hct)
- type SourceColors
Constants ¶
View Source
const BlendRatio float64 = 0.55
BlendRatio is the default blend ratio from static color
Variables ¶
View Source
var Flags = pflag.NewFlagSet("base16", pflag.ContinueOnError)
Flags are the flags used for generating colors
Functions ¶
Types ¶
type Base16 ¶
type Base16 struct {
Black, BrightBlack color.ARGB
Red, BrightRed color.ARGB
Green, BrightGreen color.ARGB
Yellow, BrightYellow color.ARGB
Blue, BrightBlue color.ARGB
Magenta, BrightMagenta color.ARGB
Cyan, BrightCyan color.ARGB
White, BrightWhite color.ARGB
// contains filtered or unexported fields
}
Base16 is the generated output
func GenerateDynamic ¶
GenerateDynamic generates base16 colors from selecting quantizes color. It takes color with long chroma distance to ensure colors has more variety
func GenerateStatic ¶
func GenerateStatic(primary color.ARGB, src SourceColors) Base16
GenerateStatic generates base16 colors from pre-defined colors
func (*Base16) SetMagenta ¶
SetMagenta sets the Magenta and Bright Magenta color
type SourceColors ¶
type SourceColors struct {
// Black is terminal color 0,8
Black color.ARGB
// Red is terminal color 1,9
Red color.ARGB
// Green is terminal color 2,A
Green color.ARGB
// Yellow is terminal color 3,B
Yellow color.ARGB
// Blue is terminal color 4,C
Blue color.ARGB
// Magenta is terminal color 5,D
Magenta color.ARGB
// Cyan is terminal color 6,E
Cyan color.ARGB
// White is terminal color 7,F
White color.ARGB
}
SourceColors is all source colors for static generation and fallback for dynamic generation
Click to show internal directories.
Click to hide internal directories.