Go package to generate and manage color palettes & schemes ūüé®

Overview

gamut

Latest Release Build Status Coverage Status Go ReportCard GoDoc

Go package to generate and manage color palettes & schemes

import "github.com/muesli/gamut"
import "github.com/muesli/gamut/palette"
import "github.com/muesli/gamut/theme"

Colors

gamut operates on various color spaces internally, but all color values you pass in as parameters and all return values will match Go’s color.Color interface.

Let’s start with the basics. Just for convenience there’s a hex-value parser:

color = gamut.Hex("#333")
color = gamut.Hex("#ABCDEF")

Both the short and standard formats are supported.

Around the Color Wheel

The Darker and Lighter functions darken and lighten respectively a given color value by a specified percentage, without changing the color's hue:

// returns a 10% darker version of color
color = gamut.Darker(color, 0.1)
// returns a 30% lighter version of color
color = gamut.Lighter(color, 0.3)

Complementary returns the complementary color for a given color:

color = gamut.Complementary(color)

Contrast returns the color with the highest contrast to a given color, either black or white:

color = gamut.Contrast(color)

To retrieve a color with the same lightness and saturation, but a different angle on the color wheel, you can use the HueOffset function:

color = gamut.HueOffset(color, 90)

You can also go in the opposite direction by using negative values.

Schemes

All the following functions return colors of a different hue, but with the same lightness and saturation as the given colors:

Triadic schemes are made up of three hues equally spaced around the color wheel:

colors = gamut.Triadic(color)

Quadratic schemes are made up of four hues equally spaced around the color wheel:

colors = gamut.Quadratic(color)

Tetradic schemes are made up by two colors and their complementary values:

colors = gamut.Tetradic(color1, color2)

Analogous schemes are created by using colors that are next to each other on the color wheel:

colors = gamut.Analogous(color)

SplitComplementary schemes are created by using colors next to the complementary value of a given color:

colors = gamut.SplitComplementary(color)

Warm/Cool Colors

ok = gamut.Warm(color)
ok = gamut.Cool(color)

Shades, Tints & Tones

Monochromatic returns colors of the same hue, but with a different saturation/lightness:

colors = gamut.Monochromatic(color, 8)

Monochromatic Palette

Shades returns colors blended from the given color to black:

colors = gamut.Shades(color, 8)

Shades Palette

Tints returns colors blended from the given color to white:

colors = gamut.Tints(color, 8)

Tints Palette

Tones returns colors blended from the given color to gray:

colors = gamut.Tones(color, 8)

Tones Palette

Blending Colors

Blends returns interpolated colors by blending two colors:

colors = gamut.Blends(color1, color2, 8)

Blends Palette

Palettes

Gamut comes with six curated color palettes: Wikipedia, Crayola, CSS, RAL, Resene, and Monokai. The Wikipedia palette is an import of common colors from Wikipedia’s List of Colors. New curated palettes and importers are welcome. Send me a pull request!

Name Colors Source
Wikipedia 1609 https://en.wikipedia.org/wiki/List_of_colors_(compact)
Crayola 180 https://en.wikipedia.org/wiki/List_of_Crayola_crayon_colors
CSS 147 https://developer.mozilla.org/en-US/docs/Web/CSS/color_value
RAL 213 https://en.wikipedia.org/wiki/List_of_RAL_colors
Resene 759 http://www.resene.co.nz
Monokai 17

The function Colors lets you retrieve all colors in a palette:

for _, c := range palette.Wikipedia.Colors() {
    fmt.Println(c.Name, c.Color)
}

This will print out a list of 1609 color names, as defined by Wikipedia.

Creating Your Own Palettes

var p gamut.Palette
p.AddColors(
    gamut.Colors{
        {"Name", gamut.Hex("#123456"), "Reference"},
        ...
    }
)

Name and Reference are optional when creating your own palettes.

Names

Each color in the curated palettes comes with an ‚Äúofficial‚ÄĚ name. You can filter palettes by colors with specific names. This code snippet will return a list of all ‚Äúblue‚ÄĚ colors in the Wikipedia palette:

colors = palette.Wikipedia.Filter("blue")

You can access a color with a specific name using the Color function:

color, ok = palette.Wikipedia.Color("Pastel blue")

Calling a palette’s Name function with a given color returns the name & distance of the closest (perceptually) matching color in it:

name, distance = palette.Wikipedia.Name(color)
// name = "Baby blue"
// distance between 0.0 and 1.0

Mixing Palettes

You can combine all colors of two palettes by mixing them:

p = palette.Crayola.MixedWith(palette.Monokai)

Perception

Sometimes you got a slice of colors, but you have a limited color palette to work with. The Clamped function returns a slice of the closest perceptually matching colors in a palette, maintaining the same order as the original slice you provided. Finally you can remix your favorite wallpapers in Crayola-style!

colors = palette.Crayola.Clamped(colors)

Generating Color Palettes

Color Generators, like the provided PastelGenerator, WarmGenerator or HappyGenerator can produce random (within the color space constraints of the generator) color palettes:

colors, err = gamut.Generate(8, gamut.PastelGenerator{})

Pastel Palette

The SimilarHueGenerator produces colors with a hue similar to a given color:

colors, err = gamut.Generate(8, gamut.SimilarHueGenerator{Color: gamut.Hex("#2F1B82")})

Similar Hue Palette

Using the ColorGenerator interface, you can also write your own color generators:

type BrightGenerator struct {
	BroadGranularity
}

func (cc BrightGenerator) Valid(col colorful.Color) bool {
	_, _, l := col.Lab()
	return 0.7 <= l && l <= 1.0
}

...
colors, err := gamut.Generate(8, BrightGenerator{})

Only colors with a lightness between 0.7 and 1.0 will be accepted by this generator.

Themes

Name Colors
Monokai 7

Roles

color = theme.MonokaiTheme.Role(theme.Foreground)

Available roles are Foreground, Background, Base, AlternateBase, Text, Selection, Highlight.

Comments
  • Standardize case for palette color names

    Standardize case for palette color names

    These commits are designed to make the Color() function a bit more user friendly. Wikipedia's list of colors is a bit troublesome when it comes to case on their color names. There is totally inconsistent casing between colors names (see 'Khaki (web) (Khaki)', 'Winter Sky', 'Sacramento State green', 'Ultramarine blue (Caran d'Ache)'), which is a pain if you want to sanitize user input. Since there is a persistent bug in strings.Title() regarding punctuation, I think the best way to improve this is to make lowercase names standard for all palettes, and cast any strings input into Color() to lowercase before searching for the associated color.

    This fix might be too drastic, since it overwrites the other default palette's rational case conventions, but I think the gains of more permissive input for the user for the Color() function make up for the work of standardizing the included palettes.

    opened by PhiloTFarnsworth 5
  • Unexpected results for darken() and lighten()

    Unexpected results for darken() and lighten()

    I try to darken / lighten (0.1, 0.2, ... 0.8) a given color and get some unexpected (?) results. What's going wrong?

    ...
    value := "#ea621f" // 'Red-Orange'
    c, err := colorful.Hex(value)
    if err != nil {
    	log.Fatalf("error <%v> at colorful.Hex(), value = %s", err, value)
    }
    var farbreihe []color.Color
    
    // color properties
    isWarm := gamut.Warm(c)
    isCool := gamut.Cool(c)
    temperature := ""
    if isWarm {
    	temperature = "warm"
    } else if isCool {
    	temperature = "cool"
    } else {
    	temperature = "Unknown Temperature"
    }
    
    // color
    farbreihe = nil
    farbreihe = append(farbreihe, c)
    farbreihe = append(farbreihe, gamut.Contrast(c))
    Table(buffer, fmt.Sprintf("Color (%s) and most Contrast Color", temperature), farbreihe)
    
    // darker
    farbreihe = nil
    farbreihe = append(farbreihe, c)
    for i := 1; i <= 8; i++ {
    	percent := 0.1 * float64(i)
    	farbreihe = append(farbreihe, gamut.Darker(c, percent))
    }
    Table(buffer, "Darker (darken the given color: 10%, 20%, ...)", farbreihe)
    
    // lighter
    farbreihe = nil
    farbreihe = append(farbreihe, c)
    for i := 1; i <= 8; i++ {
    	percent := 0.1 * float64(i)
    	farbreihe = append(farbreihe, gamut.Lighter(c, percent))
    }
    Table(buffer, "Lighter (lighten the given color: 10%, 20%, ...)", farbreihe)
    

    And that's the result I get (the values for 20%, 30%, ... are unexpected):

    Bildschirmfoto 2020-11-01 um 14 49 02 bug 
    opened by printmaps 2
  • Bump golangci/golangci-lint-action from 2 to 3

    Bump golangci/golangci-lint-action from 2 to 3

    Bumps golangci/golangci-lint-action from 2 to 3.

    Release notes

    Sourced from golangci/golangci-lint-action's releases.

    v3.0.0

    What's Changed

    New Contributors

    Full Changelog: https://github.com/golangci/golangci-lint-action/compare/v2...v3.0.0

    Bump version v2.5.2

    Bug fixes

    • 5c56cd6 Extract and don't mangle User Args. (#200)

    Dependencies

    • e3c53fe bump @‚Äčtypescript-eslint/eslint-plugin (#194)
    • 3b9f80e bump @‚Äčtypescript-eslint/parser from 4.18.0 to 4.19.0 (#195)
    • 9845713 bump @‚Äčtypes/node from 14.14.35 to 14.14.37 (#197)
    • e789ee1 bump eslint from 7.22.0 to 7.23.0 (#196)
    • f2e9a96 bump @‚Äčtypescript-eslint/eslint-plugin (#188)
    • 818081a bump @‚Äčtypes/node from 14.14.34 to 14.14.35 (#189)
    • 6671836 bump @‚Äčtypescript-eslint/parser from 4.17.0 to 4.18.0 (#190)
    • 526907e bump @‚Äčtypescript-eslint/parser from 4.16.1 to 4.17.0 (#185)
    • 6b6ba16 bump @‚Äčtypescript-eslint/eslint-plugin (#186)
    • 9cab4ef bump eslint from 7.21.0 to 7.22.0 (#187)
    • 0c76572 bump @‚Äčtypes/node from 14.14.32 to 14.14.34 (#184)
    • 0dfde21 bump @‚Äčtypescript-eslint/parser from 4.15.2 to 4.16.1 (#182)
    • 9dcf389 bump typescript from 4.2.2 to 4.2.3 (#181)
    • 34d3904 bump @‚Äčtypes/node from 14.14.31 to 14.14.32 (#180)
    • e30b22f bump @‚Äčtypescript-eslint/eslint-plugin (#179)
    • 8f30d25 bump eslint from 7.20.0 to 7.21.0 (#177)
    • 0b64a40 bump @‚Äčtypescript-eslint/parser from 4.15.1 to 4.15.2 (#176)
    • 973b3a3 bump eslint-config-prettier from 8.0.0 to 8.1.0 (#178)
    • 6ea3de1 bump @‚Äčtypescript-eslint/eslint-plugin (#175)
    • 6eec6af bump typescript from 4.1.5 to 4.2.2 (#174)

    v2.5.1

    Bug fixes:

    • d9f0e73 Check that go.mod exists in reading the version (#173)

    v2.5.0

    New Features:

    • 51485a4 Try to get version from go.mod file (#118)

    ... (truncated)

    Commits
    • c675eb7 Update all direct dependencies (#404)
    • 423fbaf Remove Setup-Go (#403)
    • bcfc6f9 build(deps-dev): bump eslint-plugin-import from 2.25.3 to 2.25.4 (#402)
    • d34ac2a build(deps): bump setup-go from v2.1.4 to v2.2.0 (#401)
    • e4b538e build(deps-dev): bump @‚Äčtypes/node from 16.11.10 to 17.0.19 (#400)
    • a288c0d build(deps): bump @‚Äčactions/cache from 1.0.8 to 1.0.9 (#399)
    • b7a34f8 build(deps): bump @‚Äčtypes/tmp from 0.2.2 to 0.2.3 (#398)
    • 129bcf9 build(deps-dev): bump @‚Äčtypes/uuid from 8.3.3 to 8.3.4 (#397)
    • 153576c build(deps-dev): bump eslint-config-prettier from 8.3.0 to 8.4.0 (#396)
    • a9a9dff build(deps): bump ansi-regex from 5.0.0 to 5.0.1 (#395)
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 1
  • Add CSS named color palette

    Add CSS named color palette

    The intention here is to use this palette to auto-support named colors in muesli/termenv#29. I figure the CSS palette makes sense there because it's a sort of a de-facto RGB palette at this point.

    enhancement 
    opened by meowgorithm 1
  • RAL palette

    RAL palette

    I have added the RAL color palette to my application. If it's of interest I could create a pull request.

    /*
    addRALColors adds RAL colors as palette (RAL source: https://gist.github.com/lunohodov/1995178)
    */
    func addRALColors() {
    	RAL.AddColors(
    		gamut.Colors{
    			{"Green beige", gamut.Hex("#BEBD7F"), "RAL 1000"},
    			{"Beige", gamut.Hex("#C2B078"), "RAL 1001"},
    			{"Sand yellow", gamut.Hex("#C6A664"), "RAL 1002"},
    			{"Signal yellow", gamut.Hex("#E5BE01"), "RAL 1003"},
    			{"Golden yellow", gamut.Hex("#CDA434"), "RAL 1004"},
    			{"Honey yellow", gamut.Hex("#A98307"), "RAL 1005"},
    			{"Maize yellow", gamut.Hex("#E4A010"), "RAL 1006"},
    			{"Daffodil yellow", gamut.Hex("#DC9D00"), "RAL 1007"},
    			{"Brown beige", gamut.Hex("#8A6642"), "RAL 1011"},
    			{"Lemon yellow", gamut.Hex("#C7B446"), "RAL 1012"},
    			{"Oyster white", gamut.Hex("#EAE6CA"), "RAL 1013"},
    			{"Ivory", gamut.Hex("#E1CC4F"), "RAL 1014"},
    			{"Light ivory", gamut.Hex("#E6D690"), "RAL 1015"},
    			{"Sulfur yellow", gamut.Hex("#EDFF21"), "RAL 1016"},
    			{"Saffron yellow", gamut.Hex("#F5D033"), "RAL 1017"},
    			{"Zinc yellow", gamut.Hex("#F8F32B"), "RAL 1018"},
    			{"Grey beige", gamut.Hex("#9E9764"), "RAL 1019"},
    			{"Olive yellow", gamut.Hex("#999950"), "RAL 1020"},
    			{"Rape yellow", gamut.Hex("#F3DA0B"), "RAL 1021"},
    			{"Traffic yellow", gamut.Hex("#FAD201"), "RAL 1023"},
    			{"Ochre yellow", gamut.Hex("#AEA04B"), "RAL 1024"},
    			{"Luminous yellow", gamut.Hex("#FFFF00"), "RAL 1026"},
    			{"Curry", gamut.Hex("#9D9101"), "RAL 1027"},
    			{"Melon yellow", gamut.Hex("#F4A900"), "RAL 1028"},
    			{"Broom yellow", gamut.Hex("#D6AE01"), "RAL 1032"},
    			{"Dahlia yellow", gamut.Hex("#F3A505"), "RAL 1033"},
    			{"Pastel yellow", gamut.Hex("#EFA94A"), "RAL 1034"},
    			{"Pearl beige", gamut.Hex("#6A5D4D"), "RAL 1035"},
    			{"Pearl gold", gamut.Hex("#705335"), "RAL 1036"},
    			{"Sun yellow", gamut.Hex("#F39F18"), "RAL 1037"},
    			{"Yellow orange", gamut.Hex("#ED760E"), "RAL 2000"},
    			{"Red orange", gamut.Hex("#C93C20"), "RAL 2001"},
    			{"Vermilion", gamut.Hex("#CB2821"), "RAL 2002"},
    			{"Pastel orange", gamut.Hex("#FF7514"), "RAL 2003"},
    			{"Pure orange", gamut.Hex("#F44611"), "RAL 2004"},
    			{"Luminous orange", gamut.Hex("#FF2301"), "RAL 2005"},
    			{"Luminous bright orange", gamut.Hex("#FFA420"), "RAL 2007"},
    			{"Bright red orange", gamut.Hex("#F75E25"), "RAL 2008"},
    			{"Traffic orange", gamut.Hex("#F54021"), "RAL 2009"},
    			{"Signal orange", gamut.Hex("#D84B20"), "RAL 2010"},
    			{"Deep orange", gamut.Hex("#EC7C26"), "RAL 2011"},
    			{"Salmon range", gamut.Hex("#E55137"), "RAL 2012"},
    			{"Pearl orange", gamut.Hex("#C35831"), "RAL 2013"},
    			{"Flame red", gamut.Hex("#AF2B1E"), "RAL 3000"},
    			{"Signal red", gamut.Hex("#A52019"), "RAL 3001"},
    			{"Carmine red", gamut.Hex("#A2231D"), "RAL 3002"},
    			{"Ruby red", gamut.Hex("#9B111E"), "RAL 3003"},
    			{"Purple red", gamut.Hex("#75151E"), "RAL 3004"},
    			{"Wine red", gamut.Hex("#5E2129"), "RAL 3005"},
    			{"Black red", gamut.Hex("#412227"), "RAL 3007"},
    			{"Oxide red", gamut.Hex("#642424"), "RAL 3009"},
    			{"Brown red", gamut.Hex("#781F19"), "RAL 3011"},
    			{"Beige red", gamut.Hex("#C1876B"), "RAL 3012"},
    			{"Tomato red", gamut.Hex("#A12312"), "RAL 3013"},
    			{"Antique pink", gamut.Hex("#D36E70"), "RAL 3014"},
    			{"Light pink", gamut.Hex("#EA899A"), "RAL 3015"},
    			{"Coral red", gamut.Hex("#B32821"), "RAL 3016"},
    			{"Rose", gamut.Hex("#E63244"), "RAL 3017"},
    			{"Strawberry red", gamut.Hex("#D53032"), "RAL 3018"},
    			{"Traffic red", gamut.Hex("#CC0605"), "RAL 3020"},
    			{"Salmon pink", gamut.Hex("#D95030"), "RAL 3022"},
    			{"Luminous red", gamut.Hex("#F80000"), "RAL 3024"},
    			{"Luminous bright red", gamut.Hex("#FE0000"), "RAL 3026"},
    			{"Raspberry red", gamut.Hex("#C51D34"), "RAL 3027"},
    			{"Pure red", gamut.Hex("#CB3234"), "RAL 3028"},
    			{"Orient red", gamut.Hex("#B32428"), "RAL 3031"},
    			{"Pearl ruby red", gamut.Hex("#721422"), "RAL 3032"},
    			{"Pearl pink", gamut.Hex("#B44C43"), "RAL 3033"},
    			{"Red lilac", gamut.Hex("#6D3F5B"), "RAL 4001"},
    			{"Red violet", gamut.Hex("#922B3E"), "RAL 4002"},
    			{"Heather violet", gamut.Hex("#DE4C8A"), "RAL 4003"},
    			{"Claret violet", gamut.Hex("#641C34"), "RAL 4004"},
    			{"Blue lilac", gamut.Hex("#6C4675"), "RAL 4005"},
    			{"Traffic purple", gamut.Hex("#A03472"), "RAL 4006"},
    			{"Purple violet", gamut.Hex("#4A192C"), "RAL 4007"},
    			{"Signal violet", gamut.Hex("#924E7D"), "RAL 4008"},
    			{"Pastel violet", gamut.Hex("#A18594"), "RAL 4009"},
    			{"Telemagenta", gamut.Hex("#CF3476"), "RAL 4010"},
    			{"Pearl violet", gamut.Hex("#8673A1"), "RAL 4011"},
    			{"Pearl black berry", gamut.Hex("#6C6874"), "RAL 4012"},
    			{"Violet blue", gamut.Hex("#354D73"), "RAL 5000"},
    			{"Green blue", gamut.Hex("#1F3438"), "RAL 5001"},
    			{"Ultramarine blue", gamut.Hex("#20214F"), "RAL 5002"},
    			{"Saphire blue", gamut.Hex("#1D1E33"), "RAL 5003"},
    			{"Black blue", gamut.Hex("#18171C"), "RAL 5004"},
    			{"Signal blue", gamut.Hex("#1E2460"), "RAL 5005"},
    			{"Brillant blue", gamut.Hex("#3E5F8A"), "RAL 5007"},
    			{"Grey blue", gamut.Hex("#26252D"), "RAL 5008"},
    			{"Azure blue", gamut.Hex("#025669"), "RAL 5009"},
    			{"Gentian blue", gamut.Hex("#0E294B"), "RAL 5010"},
    			{"Steel blue", gamut.Hex("#231A24"), "RAL 5011"},
    			{"Light blue", gamut.Hex("#3B83BD"), "RAL 5012"},
    			{"Cobalt blue", gamut.Hex("#1E213D"), "RAL 5013"},
    			{"Pigeon blue", gamut.Hex("#606E8C"), "RAL 5014"},
    			{"Sky blue", gamut.Hex("#2271B3"), "RAL 5015"},
    			{"Traffic blue", gamut.Hex("#063971"), "RAL 5017"},
    			{"Turquoise blue", gamut.Hex("#3F888F"), "RAL 5018"},
    			{"Capri blue", gamut.Hex("#1B5583"), "RAL 5019"},
    			{"Ocean blue", gamut.Hex("#1D334A"), "RAL 5020"},
    			{"Water blue", gamut.Hex("#256D7B"), "RAL 5021"},
    			{"Night blue", gamut.Hex("#252850"), "RAL 5022"},
    			{"Distant blue", gamut.Hex("#49678D"), "RAL 5023"},
    			{"Pastel blue", gamut.Hex("#5D9B9B"), "RAL 5024"},
    			{"Pearl gentian blue", gamut.Hex("#2A6478"), "RAL 5025"},
    			{"Pearl night blue", gamut.Hex("#102C54"), "RAL 5026"},
    			{"Patina green", gamut.Hex("#316650"), "RAL 6000"},
    			{"Emerald green", gamut.Hex("#287233"), "RAL 6001"},
    			{"Leaf green", gamut.Hex("#2D572C"), "RAL 6002"},
    			{"Olive green", gamut.Hex("#424632"), "RAL 6003"},
    			{"Blue green", gamut.Hex("#1F3A3D"), "RAL 6004"},
    			{"Moss green", gamut.Hex("#2F4538"), "RAL 6005"},
    			{"Grey olive", gamut.Hex("#3E3B32"), "RAL 6006"},
    			{"Bottle green", gamut.Hex("#343B29"), "RAL 6007"},
    			{"Brown green", gamut.Hex("#39352A"), "RAL 6008"},
    			{"Fir green", gamut.Hex("#31372B"), "RAL 6009"},
    			{"Grass green", gamut.Hex("#35682D"), "RAL 6010"},
    			{"Reseda green", gamut.Hex("#587246"), "RAL 6011"},
    			{"Black green", gamut.Hex("#343E40"), "RAL 6012"},
    			{"Reed green", gamut.Hex("#6C7156"), "RAL 6013"},
    			{"Yellow olive", gamut.Hex("#47402E"), "RAL 6014"},
    			{"Black olive", gamut.Hex("#3B3C36"), "RAL 6015"},
    			{"Turquoise green", gamut.Hex("#1E5945"), "RAL 6016"},
    			{"May green", gamut.Hex("#4C9141"), "RAL 6017"},
    			{"Yellow green", gamut.Hex("#57A639"), "RAL 6018"},
    			{"Pastel green", gamut.Hex("#BDECB6"), "RAL 6019"},
    			{"Chrome green", gamut.Hex("#2E3A23"), "RAL 6020"},
    			{"Pale green", gamut.Hex("#89AC76"), "RAL 6021"},
    			{"Olive drab", gamut.Hex("#25221B"), "RAL 6022"},
    			{"Traffic green", gamut.Hex("#308446"), "RAL 6024"},
    			{"Fern green", gamut.Hex("#3D642D"), "RAL 6025"},
    			{"Opal green", gamut.Hex("#015D52"), "RAL 6026"},
    			{"Light green", gamut.Hex("#84C3BE"), "RAL 6027"},
    			{"Pine green", gamut.Hex("#2C5545"), "RAL 6028"},
    			{"Mint green", gamut.Hex("#20603D"), "RAL 6029"},
    			{"Signal green", gamut.Hex("#317F43"), "RAL 6032"},
    			{"Mint turquoise", gamut.Hex("#497E76"), "RAL 6033"},
    			{"Pastel turquoise", gamut.Hex("#7FB5B5"), "RAL 6034"},
    			{"Pearl green", gamut.Hex("#1C542D"), "RAL 6035"},
    			{"Pearl opal green", gamut.Hex("#193737"), "RAL 6036"},
    			{"Pure green", gamut.Hex("#008F39"), "RAL 6037"},
    			{"Luminous green", gamut.Hex("#00BB2D"), "RAL 6038"},
    			{"Squirrel grey", gamut.Hex("#78858B"), "RAL 7000"},
    			{"Silver grey", gamut.Hex("#8A9597"), "RAL 7001"},
    			{"Olive grey", gamut.Hex("#7E7B52"), "RAL 7002"},
    			{"Moss grey", gamut.Hex("#6C7059"), "RAL 7003"},
    			{"Signal grey", gamut.Hex("#969992"), "RAL 7004"},
    			{"Mouse grey", gamut.Hex("#646B63"), "RAL 7005"},
    			{"Beige grey", gamut.Hex("#6D6552"), "RAL 7006"},
    			{"Khaki grey", gamut.Hex("#6A5F31"), "RAL 7008"},
    			{"Green grey", gamut.Hex("#4D5645"), "RAL 7009"},
    			{"Tarpaulin grey", gamut.Hex("#4C514A"), "RAL 7010"},
    			{"Iron grey", gamut.Hex("#434B4D"), "RAL 7011"},
    			{"Basalt grey", gamut.Hex("#4E5754"), "RAL 7012"},
    			{"Brown grey", gamut.Hex("#464531"), "RAL 7013"},
    			{"Slate grey", gamut.Hex("#434750"), "RAL 7015"},
    			{"Anthracite grey", gamut.Hex("#293133"), "RAL 7016"},
    			{"Black grey", gamut.Hex("#23282B"), "RAL 7021"},
    			{"Umbra grey", gamut.Hex("#332F2C"), "RAL 7022"},
    			{"Concrete grey", gamut.Hex("#686C5E"), "RAL 7023"},
    			{"Graphite grey", gamut.Hex("#474A51"), "RAL 7024"},
    			{"Granite grey", gamut.Hex("#2F353B"), "RAL 7026"},
    			{"Stone grey", gamut.Hex("#8B8C7A"), "RAL 7030"},
    			{"Blue grey", gamut.Hex("#474B4E"), "RAL 7031"},
    			{"Pebble grey", gamut.Hex("#B8B799"), "RAL 7032"},
    			{"Cement grey", gamut.Hex("#7D8471"), "RAL 7033"},
    			{"Yellow grey", gamut.Hex("#8F8B66"), "RAL 7034"},
    			{"Light grey", gamut.Hex("#CBD0CC"), "RAL 7035"},
    			{"Platinum grey", gamut.Hex("#7F7679"), "RAL 7036"},
    			{"Dusty grey", gamut.Hex("#7D7F7D"), "RAL 7037"},
    			{"Agate grey", gamut.Hex("#B5B8B1"), "RAL 7038"},
    			{"Quartz grey", gamut.Hex("#6C6960"), "RAL 7039"},
    			{"Window grey", gamut.Hex("#9DA1AA"), "RAL 7040"},
    			{"Traffic grey A", gamut.Hex("#8D948D"), "RAL 7042"},
    			{"Traffic grey B", gamut.Hex("#4E5452"), "RAL 7043"},
    			{"Silk grey", gamut.Hex("#CAC4B0"), "RAL 7044"},
    			{"Telegrey 1", gamut.Hex("#909090"), "RAL 7045"},
    			{"Telegrey 2", gamut.Hex("#82898F"), "RAL 7046"},
    			{"Telegrey 4", gamut.Hex("#D0D0D0"), "RAL 7047"},
    			{"Pearl mouse grey", gamut.Hex("#898176"), "RAL 7048"},
    			{"Green brown", gamut.Hex("#826C34"), "RAL 8000"},
    			{"Ochre brown", gamut.Hex("#955F20"), "RAL 8001"},
    			{"Signal brown", gamut.Hex("#6C3B2A"), "RAL 8002"},
    			{"Clay brown", gamut.Hex("#734222"), "RAL 8003"},
    			{"Copper brown", gamut.Hex("#8E402A"), "RAL 8004"},
    			{"Fawn brown", gamut.Hex("#59351F"), "RAL 8007"},
    			{"Olive brown", gamut.Hex("#6F4F28"), "RAL 8008"},
    			{"Nut brown", gamut.Hex("#5B3A29"), "RAL 8011"},
    			{"Red brown", gamut.Hex("#592321"), "RAL 8012"},
    			{"Sepia brown", gamut.Hex("#382C1E"), "RAL 8014"},
    			{"Chestnut brown", gamut.Hex("#633A34"), "RAL 8015"},
    			{"Mahogany brown", gamut.Hex("#4C2F27"), "RAL 8016"},
    			{"Chocolate brown", gamut.Hex("#45322E"), "RAL 8017"},
    			{"Grey brown", gamut.Hex("#403A3A"), "RAL 8019"},
    			{"Black brown", gamut.Hex("#212121"), "RAL 8022"},
    			{"Orange brown", gamut.Hex("#A65E2E"), "RAL 8023"},
    			{"Beige brown", gamut.Hex("#79553D"), "RAL 8024"},
    			{"Pale brown", gamut.Hex("#755C48"), "RAL 8025"},
    			{"Terra brown", gamut.Hex("#4E3B31"), "RAL 8028"},
    			{"Pearl copper", gamut.Hex("#763C28"), "RAL 8029"},
    			{"Cream", gamut.Hex("#FDF4E3"), "RAL 9001"},
    			{"Grey white", gamut.Hex("#E7EBDA"), "RAL 9002"},
    			{"Signal white", gamut.Hex("#F4F4F4"), "RAL 9003"},
    			{"Signal black", gamut.Hex("#282828"), "RAL 9004"},
    			{"Jet black", gamut.Hex("#0A0A0A"), "RAL 9005"},
    			{"White aluminium", gamut.Hex("#A5A5A5"), "RAL 9006"},
    			{"Grey aluminium", gamut.Hex("#8F8F8F"), "RAL 9007"},
    			{"Pure white", gamut.Hex("#FFFFFF"), "RAL 9010"},
    			{"Graphite black", gamut.Hex("#1C1C1C"), "RAL 9011"},
    			{"Traffic white", gamut.Hex("#F6F6F6"), "RAL 9016"},
    			{"Traffic black", gamut.Hex("#1E1E1E"), "RAL 9017"},
    			{"Papyrus white", gamut.Hex("#CFD3CD"), "RAL 9018"},
    			{"Pearl light grey", gamut.Hex("#9C9C9C"), "RAL 9022"},
    			{"Pearl dark grey", gamut.Hex("#828282"), "RAL 9023"},
    		})
    }
    
    Bildschirmfoto 2020-11-06 um 17 28 15 enhancement 
    opened by printmaps 1
  • Bump actions/setup-go from 2 to 3

    Bump actions/setup-go from 2 to 3

    Bumps actions/setup-go from 2 to 3.

    Release notes

    Sourced from actions/setup-go's releases.

    v3.0.0

    What's Changed

    Breaking Changes

    With the update to Node 16, all scripts will now be run with Node 16 rather than Node 12.

    This new major release removes the stable input, so there is no need to specify additional input to use pre-release versions. This release also corrects the pre-release versions syntax to satisfy the SemVer notation (1.18.0-beta1 -> 1.18.0-beta.1, 1.18.0-rc1 -> 1.18.0-rc.1).

    steps:
      - uses: actions/[email protected]
      - uses: actions/[email protected]
        with:
          go-version: '1.18.0-rc.1' 
      - run: go version
    

    Add check-latest input

    In scope of this release we add the check-latest input. If check-latest is set to true, the action first checks if the cached version is the latest one. If the locally cached version is not the most up-to-date, a Go version will then be downloaded from go-versions repository. By default check-latest is set to false. Example of usage:

    steps:
      - uses: actions/[email protected]
      - uses: actions/[email protected]
        with:
          go-version: '1.16'
          check-latest: true
      - run: go version
    

    Moreover, we updated @actions/core from 1.2.6 to 1.6.0

    v2.1.5

    In scope of this release we updated matchers.json to improve the problem matcher pattern. For more information please refer to this pull request

    v2.1.4

    What's Changed

    New Contributors

    Full Changelog: https://github.com/actions/setup-go/compare/v2.1.3...v2.1.4

    v2.1.3

    • Updated communication with runner to use environment files rather then workflow commands

    v2.1.2

    This release includes vendored licenses for this action's npm dependencies.

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • Bump actions/checkout from 2 to 3

    Bump actions/checkout from 2 to 3

    Bumps actions/checkout from 2 to 3.

    Release notes

    Sourced from actions/checkout's releases.

    v3.0.0

    • Update default runtime to node16

    v2.4.0

    • Convert SSH URLs like org-<ORG_ID>@github.com: to https://github.com/ - pr

    v2.3.5

    Update dependencies

    v2.3.4

    v2.3.3

    v2.3.2

    Add Third Party License Information to Dist Files

    v2.3.1

    Fix default branch resolution for .wiki and when using SSH

    v2.3.0

    Fallback to the default branch

    v2.2.0

    Fetch all history for all tags and branches when fetch-depth=0

    v2.1.1

    Changes to support GHES (here and here)

    v2.1.0

    Changelog

    Sourced from actions/checkout's changelog.

    Changelog

    v2.3.1

    v2.3.0

    v2.2.0

    v2.1.1

    • Changes to support GHES (here and here)

    v2.1.0

    v2.0.0

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • go vet warning

    go vet warning "composite literal uses unkeyed fields"

    You can avoid this go vet warning:

    ...
    gamut.Colors{
    	{"Kadminumrot", gamut.Hex(fmt.Sprintf("#%02x%02x%02x", 230, 50, 0)), "Rot-1"},
    	{Name: "Signalrot", Color: gamut.Hex(fmt.Sprintf("#%02x%02x%02x", 225, 0, 0)), Reference: "Rot-2"},
    ...
    

    The first definition ("Kadminumrot", ...) produces the warning, the second definition (Name: "Signalrot", ...) does not.

    https://stackoverflow.com/questions/54548441/composite-literal-uses-unkeyed-fields: Ignoring this vet warning has the potential to lead to really nasty and hard to track down runtime bugs, so you'd be better off if you were to always specify the keys of 3rd party structs explicitly.

    It's a cosmetic change because you are the owner and not a user of the lib. The warning can easily be removed in your lib with search and replace.

    opened by printmaps 0
  • calling Darker() on a dark color can return a lighter color

    calling Darker() on a dark color can return a lighter color

    Great library - thanks for making it. One small thing I noticed is that calling Darker() on a dark RGB color can actually return a lighter RGB color. It would be more intuitive (at least to me!) if it clamped to black. On a related note it would be useful to have helper functions like IsDarker(color1, color2) bool and GetContrast(color1, color2) in the package.

    bug 
    opened by kmanley 2
  • Masking for common colour blindnesses?

    Masking for common colour blindnesses?

    Hi, Great API. I was curious as to if you have considered support for, (or maybe clamping examples for), supporting the various forms of colour blindness for palette generation? I've not found many APIs supporting it. It's an interesting area, and something I've wanting to be able to do for graphs/charts before.

    enhancement 
    opened by tcolgate 6
Releases(v0.3.1)
  • v0.3.1(Jul 22, 2022)

    What's Changed

    • Bump golangci/golangci-lint-action from 2 to 3 by @dependabot in https://github.com/muesli/gamut/pull/18
    • Bump actions/checkout from 2 to 3 by @dependabot in https://github.com/muesli/gamut/pull/19
    • Bump actions/setup-go from 2 to 3 by @dependabot in https://github.com/muesli/gamut/pull/20

    Full Changelog: https://github.com/muesli/gamut/compare/v0.3.0...v0.3.1

    Source code(tar.gz)
    Source code(zip)
  • v0.3.0(Dec 28, 2021)

    What's Changed

    • Standardize case for palette color names by @muesli in https://github.com/muesli/gamut/pull/15
    • Add ToHex(color.Color) for convenience by @muesli in https://github.com/muesli/gamut/pull/16

    Full Changelog: https://github.com/muesli/gamut/compare/v0.2.0...v0.3.0

    Source code(tar.gz)
    Source code(zip)
  • v0.2.0(Dec 7, 2020)

  • v0.1.2(Nov 9, 2020)

  • v0.1.1(Nov 1, 2020)

  • v0.1.0(Oct 27, 2020)

Owner
Christian Muehlhaeuser
Geek, Gopher, Software Developer, Maker, Opensource Advocate, Tech Enthusiast, Photographer, Board and Card Gamer
Christian Muehlhaeuser
Singlestore event analytics - Evaluation of sortable ID generation schemes

Singlestore event analytics - Evaluation of sortable ID generation schemes

Carl Sverre 1 Jan 25, 2022
Simple library to handle ANSI functions and parsing of color formatting strings

Emerald A basic color library for use in my Go projects, built on top of mgutz/ansi. Package ansi is a small, fast library to create ANSI colored stri

Josh Willox 0 Nov 15, 2021
A color manipulation and conversion library for Go. ūüĆą ‚ú®

Khroma Khroma is a color manipulation and conversion library for Go. ‚ú® ?? Example package main import ( "log" "github.com/qbee-org/khroma" ) func

QBee 2 May 30, 2022
Color generator with golang

color-generator How to use this repo <img src="https://color-pallete-gen.herokuapp.com/hexCode" /> Like this: Getting Started Copy sample.env to .env

Jo√£o Marcus Fernandes 0 Oct 22, 2021
Wl-gammarelay - Wayland utility for changing color temperature using hotkeys

wl-gammarelay This utility was developed from gammastep, a fork of redshift as w

Jerko Steiner 17 Sep 18, 2022
Color lets you use colorized outputs in terms of ANSI Escape Codes in Go (Golang)

Color lets you use colorized outputs in terms of ANSI Escape Codes in Go (Golang). It has support for Windows too! The API can be used in several ways, pick one that suits you.

Sensio 0 Feb 5, 2022
Easy to use open source hardware to drive WS2811 LEDs with high-quality color

STOP DOING FADECANDY LEDs were not supposed to be given data pins YEARS of "temporal dithering" but no real-world use found for having more than three

Micah Elizabeth Scott 1.2k Sep 6, 2022
A funny utility to manage your PS1 variable.

PSOne Introduction Are you a Veteran Unix Admin? If so, you probably know the charm of the PS1 environment variable. For a deep focus I suggest you to

Alessio Greggi 5 May 17, 2022
generate random data like name, email, uuid, address, images and etc.

gg-rand generate random data like name, email, uuid, address, images and etc. build and install: make run: gg-rand $ gg-rand SillyName : Knavesa

bingoohuang 2 Mar 13, 2022
An application written in Go to generate fractals like the Mandelbrot set and the Julia set.

Fractals An application written in Go to generate fractals like the Mandelbrot set and the Julia set. Screenshots Mandelbrot set Julia set Prerequisit

null 0 May 9, 2022
A package for running subprocesses in Go, similar to Python's subprocesses package.

A package for running subprocesses in Go, similar to Python's subprocesses package.

Esteban Garcia 5 Jul 28, 2022
Utility to restrict which package is allowed to import another package.

go-import-rules Utility to restrict which package is allowed to import another package. This tool will read import-rules.yaml or import-rules.yml in t

PAYFAZZ 0 Jan 7, 2022
libraries for various programming languages that make it easy to generate per-process trace files that can be loaded into chrome://tracing

chrometracing: chrome://tracing trace_event files The chrometracing directory contains libraries for various programming languages that make it easy t

Google 22 Jul 8, 2022
go generate based graphql server library

gqlgen What is gqlgen? gqlgen is a Go library for building GraphQL servers without any fuss. gqlgen is based on a Schema first approach ‚ÄĒ You get to D

99designs 8.1k Sep 24, 2022
Generate Go clients from anchor IDLs for Solana blockchain programs

usage anchor-go --src=/path/to/idl.json Generated Code will be generated and saved to ./generated/. TODO instructions accounts types events errors han

Slavomir 79 Sep 15, 2022
Utilities to generate (reference) documentation for the docker CLI

About This is a library containing utilities to generate (reference) documentation for the docker CLI on docs.docker.com. Disclaimer This library is i

Docker 14 Jun 25, 2022
Generate simple CHANGELOG

changelog Generate simple CHANGELOG Install Download the one that suits your environment and place it in a location that is in your PATH. https://gith

tricot 2 Oct 10, 2021
Generate some random data

fake-data-generator-api generate some random data installing and using

Miguel 2 Jul 14, 2022
A utility to generate SPDX-compliant Bill of Materials manifests

Kubernetes Template Project The Kubernetes Template Project is a template for starting new projects in the GitHub organizations owned by Kubernetes. A

Kubernetes SIGs 135 Sep 25, 2022