Documentation ¶
Index ¶
- Constants
- Variables
- func BgFinder(nc NamedColors) colorful.Color
- func ExtremeColorBgFinder(nc NamedColors) colorful.Color
- func ExtremeColorFgFinder(nc NamedColors) colorful.Color
- func FgFinder(nc NamedColors) colorful.Color
- func OrderedKeys(n NamedColors) []string
- type AccentColors
- type AccentPairGenerator
- type Accents
- type Base
- type BaseColors
- type ByLightness
- type ColorFinder
- type ColorList
- type ColorTransformer
- type HexColor
- type NamedColors
- func (n NamedColors) ColorList() ColorList
- func (n NamedColors) FilterPrefix(prefix ...string) NamedColors
- func (n NamedColors) FilterSuffix(suffix ...string) NamedColors
- func (nc NamedColors) IsDarkOnBright(bgName, fgName string) bool
- func (n NamedColors) WithPrefix(prefix string) NamedColors
- func (n NamedColors) WithSuffix(suffix string) NamedColors
- type Palette
- type Solarized
Constants ¶
const ( SolarizedBase03 = "#002b36" SolarizedBase02 = "#073642" SolarizedBase01 = "#586e75" SolarizedBase00 = "#657b83" SolarizedBase0 = "#839496" SolarizedBase1 = "#93a1a1" SolarizedBase2 = "#eee8d5" SolarizedBase3 = "#fdf6e3" SolarizedBlue = "#268bd2" SolarizedCyan = "#2aa198" SolarizedGreen = "#859900" SolarizedMagenta = "#d33682" SolarizedOrange = "#cb4b16" SolarizedRed = "#dc322f" SolarizedViolet = "#6c71c4" SolarizedYellow = "#b58900" GruvboxDark0Hard = "#1d2021" GruvboxDark0 = "#282828" GruvboxDark0Soft = "#32302f" GruvboxDark1 = "#3c3836" GruvboxDark2 = "#504945" GruvboxDark3 = "#665c54" GruvboxDark4 = "#7c6f64" GruvboxGray = "#928374" GruvboxLight0Hard = "#f9f5d7" GruvboxLight0 = "#fbf1c7" GruvboxLight0Soft = "#f2e5bc" GruvboxLight1 = "#ebdbb2" GruvboxLight2 = "#d5c4a1" GruvboxLight3 = "#bdae93" GruvboxLight4 = "#a89984" GruvboxRed = "#cc241d" GruvboxGreen = "#98971a" GruvboxYellow = "#d79921" GruvboxBlue = "#458588" GruvboxPurple = "#b16286" GruvboxAqua = "#689d6a" GruvboxOrange = "#d65d0e" GruvboxBrightRed = "#fb4933" GruvboxBrightGreen = "#b8bb26" GruvboxBrightYellow = "#fabd2f" GruvboxBrightBlue = "#83a598" GruvboxBrightPurple = "#d3869b" GruvboxBrightAqua = "#8ec07c" GruvboxBrightOrange = "#fe8019" GruvboxDarkRed = "#9d0006" GruvboxDarkGreen = "#79740e" GruvboxDarkYellow = "#b57614" GruvboxDarkBlue = "#076678" GruvboxDarkPurple = "#8f3f71" GruvboxDarkAqua = "#427b58" GruvboxDarkOrange = "#af3a03" ZenburnFgM1 = "#656555" ZenburnFgM05 = "#989890" ZenburnFg = "#DCDCCC" ZenburnFgP1 = "#FFFFEF" ZenburnFgP2 = "#FFFFFD" ZenburnBgM2 = "#000000" ZenburnBgM1 = "#2B2B2B" ZenburnBgM08 = "#303030" ZenburnBgM05 = "#383838" ZenburnBg = "#3F3F3F" ZenburnBgP05 = "#494949" ZenburnBgP1 = "#4F4F4F" ZenburnBgP2 = "#5F5F5F" ZenburnBgP3 = "#6F6F6F" ZenburnRedM6 = "#6C3333" ZenburnRedM5 = "#7C4343" ZenburnRedM4 = "#8C5353" ZenburnRedM3 = "#9C6363" ZenburnRedM2 = "#AC7373" ZenburnRedM1 = "#BC8383" ZenburnRed = "#CC9393" ZenburnRedP1 = "#DCA3A3" ZenburnRedP2 = "#ECB3B3" ZenburnOrange = "#DFAF8F" ZenburnYellowM2 = "#D0BF8F" ZenburnYellowM1 = "#E0CF9F" ZenburnYellow = "#F0DFAF" ZenburnGreenM5 = "#2F4F2F" ZenburnGreenM4 = "#3F5F3F" ZenburnGreenM3 = "#4F6F4F" ZenburnGreenM2 = "#5F7F5F" ZenburnGreenM1 = "#6F8F6F" ZenburnGreen = "#7F9F7F" ZenburnGreenP1 = "#8FB28F" ZenburnGreenP2 = "#9FC59F" ZenburnGreenP3 = "#AFD8AF" ZenburnGreenP4 = "#BFEBBF" ZenburnCyan = "#93E0E3" ZenburnBlueP3 = "#BDE0F3" ZenburnBlueP2 = "#ACE0E3" ZenburnBlueP1 = "#94BFF3" ZenburnBlue = "#8CD0D3" ZenburnBlueM1 = "#7CB8BB" ZenburnBlueM2 = "#6CA0A3" ZenburnBlueM3 = "#5C888B" ZenburnBlueM4 = "#4C7073" ZenburnBlueM5 = "#366060" ZenburnMagenta = "#DC8CC3" // ehm, monokaiXX are probably not "correct" in any way Monokai03 = "#272822" Monokai02 = "#3E3D31" Monokai01 = "#75715E" Monokai00 = "#49483E" Monokai0 = "#F8F8F2" MonokaiYellow = "#E6DB74" MonokaiOrange = "#FD971F" MonokaiRed = "#F92672" MonokaiMagenta = "#FD5FF0" MonokaiBlue = "#66D9EF" MonokaiGreen = "#A6E22E" MonokaiCyan = "#A1EFE4" MonokaiViolet = "#AE81FF" )
Color constants for various popular palettes
Variables ¶
var ( AllPalettes = []Palette{ SolarizedDarkPalette, SolarizedLightPalette, SolarizedDarkHighContrastPalette, SolarizedLightHighContrastPalette, SelenizedBlackPalette, SelenizedDarkPalette, SelenizedLightPalette, SelenizedWhitePalette, GruvboxDarkPalette, GruvboxLightPalette, ZenburnPalette, MonokaiPalette, } SolarizedDarkPalette = Palette{ Name: "solarized-dark", Solarized: solarized, Accent1Pair: AccentPairGenerator{ BlendBackgroundAmout: default1BgFg.BlendBackgroundAmout, BlendForegroundAmout: default1BgFg.BlendForegroundAmout, Gamma: default1BgFg.Gamma, ForegroundBlendFinder: NamedColorFinder("base1"), BackgroundBlendFinder: default1BgFg.BackgroundBlendFinder, MinimumLightnessDifference: 0.4, }, Accent2Pair: AccentPairGenerator{ BlendBackgroundAmout: default2BgFg.BlendBackgroundAmout, BlendForegroundAmout: default2BgFg.BlendForegroundAmout, Gamma: default2BgFg.Gamma, ForegroundBlendFinder: NamedColorFinder("base1"), BackgroundBlendFinder: default2BgFg.BackgroundBlendFinder, MinimumLightnessDifference: 0.4, }, } SolarizedLightPalette = Palette{ Name: "solarized-light", Solarized: solarized, Inverse: true, Accent1Pair: default1BgFg, Accent2Pair: default2BgFg, } SolarizedDarkHighContrastPalette = Palette{ Name: "solarized-dark-high-contrast", Solarized: solarizedDarkHighContrast, Accent1Pair: AccentPairGenerator{ BlendBackgroundAmout: default1BgFg.BlendBackgroundAmout, BlendForegroundAmout: default1BgFg.BlendForegroundAmout, Gamma: default1BgFg.Gamma, ForegroundBlendFinder: NamedColorFinder("base1"), BackgroundBlendFinder: default1BgFg.BackgroundBlendFinder, MinimumLightnessDifference: 0.4, }, Accent2Pair: AccentPairGenerator{ BlendBackgroundAmout: default2BgFg.BlendBackgroundAmout, BlendForegroundAmout: default2BgFg.BlendForegroundAmout, Gamma: default2BgFg.Gamma, ForegroundBlendFinder: NamedColorFinder("base1"), BackgroundBlendFinder: default2BgFg.BackgroundBlendFinder, MinimumLightnessDifference: 0.4, }, } SolarizedLightHighContrastPalette = Palette{ Name: "solarized-light-high-contrast", Solarized: solarizedLightHighContrast, Inverse: true, Accent1Pair: default1BgFg, Accent2Pair: default2BgFg, } GruvboxDarkPalette = Palette{ Name: "gruvbox-dark", Solarized: gruvboxDark, Accent1Pair: default1BgFg, Accent2Pair: default2BgFg, } GruvboxLightPalette = Palette{ Name: "gruvbox-light", Solarized: gruvboxLight, Inverse: true, Accent1Pair: default1BgFg, Accent2Pair: default2BgFg, } ZenburnPalette = Palette{ Name: "zenburn", Solarized: zenburn, Accent1Pair: default1BgFg, Accent2Pair: default2BgFg, } MonokaiPalette = Palette{ Name: "monokai", Solarized: monokai, Accent1Pair: default1BgFg, Accent2Pair: default2BgFg, } SelenizedDarkPalette = Palette{ Name: "selenized-dark", Solarized: selenizedDark, Accent1Pair: default1BgFg, Accent2Pair: default2BgFg, } SelenizedBlackPalette = Palette{ Name: "selenized-black", Solarized: selenizedBlack, Accent1Pair: default1BgFg, Accent2Pair: default2BgFg, } SelenizedLightPalette = Palette{ Name: "selenized-light", Solarized: selenizedLight, Accent1Pair: default1BgFg, Accent2Pair: default2BgFg, } SelenizedWhitePalette = Palette{ Name: "selenized-white", Solarized: selenizedWhite, Accent1Pair: default1BgFg, Accent2Pair: default2BgFg, } )
Functions ¶
func BgFinder ¶
func BgFinder(nc NamedColors) colorful.Color
BgFinder returns base03 from the input Solarized
func ExtremeColorBgFinder ¶
func ExtremeColorBgFinder(nc NamedColors) colorful.Color
ExtremeColorFgFinder finds the lightest base tone for light on dark or the darkest color for dark on light.
func ExtremeColorFgFinder ¶
func ExtremeColorFgFinder(nc NamedColors) colorful.Color
ExtremeColorFgFinder finds the darkest base tone for light on dark or the lightest color for dark on light.
func FgFinder ¶
func FgFinder(nc NamedColors) colorful.Color
FgFinder finds base0 from the input Solarized
func OrderedKeys ¶
func OrderedKeys(n NamedColors) []string
Orderedkeys returns the keys in a order that is like how solarized names should be ordered.
primary orer is:
1. base names 2. accent colors 3. names that contain base names 4. names that contain accent color names 5. the rest
secondary sort order is by string comparison.
Types ¶
type AccentColors ¶
type AccentColors [8]colorful.Color
type AccentPairGenerator ¶
type AccentPairGenerator struct { BlendBackgroundAmout float64 BlendForegroundAmout float64 Gamma float64 MinimumLightnessDifference float64 BackgroundBlendFinder ColorFinder ForegroundBlendFinder ColorFinder }
AccentPairGenerator generates paris of background and foreground colors that are meant to be used in pairs.
func (*AccentPairGenerator) Generate ¶
func (g *AccentPairGenerator) Generate(solarized Solarized) (backgrounds, foregrounds Accents)
type Accents ¶
type Accents struct { Yellow HexColor Orange HexColor Red HexColor Magenta HexColor Violet HexColor Blue HexColor Cyan HexColor Green HexColor }
Accents .
func NewAccents ¶
func NewAccents(cc [8]colorful.Color) Accents
func (Accents) ChangeLightness ¶
func (Accents) ChangeSaturation ¶
func (Accents) Colors ¶
func (s Accents) Colors() AccentColors
func (Accents) NamedColors ¶
func (ac Accents) NamedColors() NamedColors
type Base ¶
type Base struct { Base03 HexColor Base02 HexColor Base01 HexColor Base00 HexColor Base0 HexColor Base1 HexColor Base2 HexColor Base3 HexColor }
func (Base) ChangeLightness ¶
func (Base) Colors ¶
func (s Base) Colors() BaseColors
func (Base) IsDarkOnBright ¶
Returns true if the LAB lightness of base0 is larger than base03.
func (Base) NamedColors ¶
func (s Base) NamedColors() NamedColors
type BaseColors ¶
type BaseColors [8]colorful.Color
type ByLightness ¶
type ByLightness ColorList
ByLightness sorts a list of colors by LAB L(ightness) value
func (ByLightness) Len ¶
func (a ByLightness) Len() int
func (ByLightness) Less ¶
func (a ByLightness) Less(i, j int) bool
func (ByLightness) Swap ¶
func (a ByLightness) Swap(i, j int)
type ColorFinder ¶
type ColorFinder func(NamedColors) colorful.Color
Find a specific color in a Solarized based on some preconditon
func NamedColorFinder ¶
func NamedColorFinder(name string) ColorFinder
NamedColorFinder extracts a named color from a palette
type ColorList ¶
type ColorList []colorful.Color
func (ColorList) ByLightness ¶
returns the ColorList ordered by Lightness, darkest first
func (ColorList) ByLightnessDesc ¶
returns the ColorList ordered by Lightness, lightest first
type ColorTransformer ¶
type ColorTransformer func(colorful.Color) colorful.Color
type NamedColors ¶
func (NamedColors) ColorList ¶
func (n NamedColors) ColorList() ColorList
func (NamedColors) FilterPrefix ¶
func (n NamedColors) FilterPrefix(prefix ...string) NamedColors
func (NamedColors) FilterSuffix ¶
func (n NamedColors) FilterSuffix(suffix ...string) NamedColors
func (NamedColors) IsDarkOnBright ¶
func (nc NamedColors) IsDarkOnBright(bgName, fgName string) bool
Returns true if the LAB lightness of bgName is larger than fgName.
func (NamedColors) WithPrefix ¶
func (n NamedColors) WithPrefix(prefix string) NamedColors
WithPrefix returns a copy of named colors where all keys are prefixed.
func (NamedColors) WithSuffix ¶
func (n NamedColors) WithSuffix(suffix string) NamedColors
WithSuffix returns a copy of named colors where all keys are suffixed.
type Palette ¶
type Palette struct { Name string Inverse bool Solarized Solarized Accent1Pair AccentPairGenerator Accent2Pair AccentPairGenerator }
Palette .
func (Palette) Generate ¶
func (p Palette) Generate() NamedColors