[The colorlist package] 4 started as a fork of github.com/btracey/colorlist. Since then it has diverged enough that retaining it as a fork is probably not useful. Brendan decided to change his repository name to colors so I've un-hitched this from his original repository which he has now marked 'deprecated'. This is now being re-issued as a new repository : github.com/hotei/colorlist.
The main difference between the packages is that Brendans provides pre-named variables representing colors. For example colors.Black is an RGBA value in his package. I chose to go the route of color lookup tables. The same value in my package would be colorlist.ColorVal("black"). You can also specify color values with rgb hex codes. Evaluating colorlist.ColorVal("#f5F5f5") returns the same result as colorlist.ColorVal("WhiteSmoke") This can be useful if you're using a color picker from PhotoShop or Gimp to grab specific colors.
There are advantages and disadvantages to both approaches. In his system a bad
color name results in a compile time error - which is not always a bad thing.
In mine it results in a default color (black) being substituted but the program
continues to run - though of course it might not produce the expected colors (unless
you spelled it "blackk" :-) .
With my system configuration files can easily map colors from strings to RGBA values. You can also add your own colors to the maps on the fly and even change the existing color values if you wish.
This package contains a list of about 150 standard colors in image.color RGBA format.
The first set (16) colors is specified by the HTML 4 standard
The second set of colors are specified by the CSS3 standard
Color-book.org is a web site with many colors displayed and listed in both rgb and cmyk forms. You can easily add any of these with AddColor().
There's a test file with examples to show usage.
License is BSD-style.
Inspect the GoDocs at godoc.org
go get github.com/hotei/colorlist
import "github.com/hotei/colorlist"
- Color-Book.org a web site with many colors displayed and listed in both rgb and cmyk forms.
- W3 HTML 4 spec
- W3 svg color spec
- X-11 Color names
Copyright ©2013 David Rook except where otherwise noted. All rights reserved. Use of this file is governed by a BSD-style license that can be found in the LICENSE_MDR.md file.