Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Basic = []Colour{ {Name: "black", Colour: colorful.Color{R: 0, G: 0, B: 0}}, {Name: "blue", Colour: colorful.Color{R: 0, G: 0, B: 1}}, {Name: "cyan", Colour: colorful.Color{R: 0, G: 1, B: 1}}, {Name: "green", Colour: colorful.Color{R: 0, G: 0.5019607843137255, B: 0}}, {Name: "teal", Colour: colorful.Color{R: 0, G: 0.5019607843137255, B: 0.5019607843137255}}, {Name: "turquoise", Colour: colorful.Color{R: 0.25098039215686274, G: 0.8784313725490196, B: 0.8156862745098039}}, {Name: "indigo", Colour: colorful.Color{R: 0.29411764705882354, G: 0, B: 0.5098039215686274}}, {Name: "gray", Colour: colorful.Color{R: 0.5019607843137255, G: 0.5019607843137255, B: 0.5019607843137255}}, {Name: "purple", Colour: colorful.Color{R: 0.5019607843137255, G: 0, B: 0.5019607843137255}}, {Name: "brown", Colour: colorful.Color{R: 0.6470588235294118, G: 0.16470588235294117, B: 0.16470588235294117}}, {Name: "tan", Colour: colorful.Color{R: 0.8235294117647058, G: 0.7058823529411764, B: 0.5490196078431373}}, {Name: "violet", Colour: colorful.Color{R: 0.9333333333333333, G: 0.5098039215686274, B: 0.9333333333333333}}, {Name: "beige", Colour: colorful.Color{R: 0.9607843137254902, G: 0.9607843137254902, B: 0.8627450980392157}}, {Name: "fuchsia", Colour: colorful.Color{R: 1, G: 0, B: 1}}, {Name: "gold", Colour: colorful.Color{R: 1, G: 0.8431372549019608, B: 0}}, {Name: "magenta", Colour: colorful.Color{R: 1, G: 0, B: 1}}, {Name: "orange", Colour: colorful.Color{R: 1, G: 0.6470588235294118, B: 0}}, {Name: "pink", Colour: colorful.Color{R: 1, G: 0.7529411764705882, B: 0.796078431372549}}, {Name: "red", Colour: colorful.Color{R: 1, G: 0, B: 0}}, {Name: "white", Colour: colorful.Color{R: 1, G: 1, B: 1}}, {Name: "yellow", Colour: colorful.Color{R: 1, G: 1, B: 0}}, } HTML = []Colour{}/* 147 elements not displayed */ NTC = []Colour{}/* 1566 elements not displayed */ Pantone = []Colour{}/* 120 elements not displayed */ ROYGBIV = []Colour{ {Name: "red", Colour: colorful.Color{R: 1, G: 0, B: 0}}, {Name: "orange", Colour: colorful.Color{R: 1, G: 0.6470588235294118, B: 0}}, {Name: "yellow", Colour: colorful.Color{R: 1, G: 1, B: 0}}, {Name: "green", Colour: colorful.Color{R: 0, G: 0.5019607843137255, B: 0}}, {Name: "blue", Colour: colorful.Color{R: 0, G: 0, B: 1}}, {Name: "indigo", Colour: colorful.Color{R: 0.29411764705882354, G: 0, B: 0.5098039215686274}}, {Name: "violet", Colour: colorful.Color{R: 0.9333333333333333, G: 0.5098039215686274, B: 0.9333333333333333}}, } )
Functions ¶
This section is empty.
Types ¶
type Results ¶
Results contains all colour matches, with each list containing an array of colours sorted by their similarity to the given colour.
func FromRGB ¶
FromRGB takes RGB values and returns the closest colour name.
The alpha value is set to 1. Use FromRGBA if you need to control the alpha.
func (Results) ClosestName ¶
ClosestName returns the name of the colour whose RGB value is closest to the original value.
Click to show internal directories.
Click to hide internal directories.