Documentation ¶
Overview ¶
Package chroma provides a way of finding names of ~2800 colors.
These colors have been sourced from: https://github.com/ayushoriginal/Optimized-RGB-To-ColorName
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Nearest ¶
type Nearest struct { Color Color RGBDistance RGBDistance }
Nearest contains a Color, and distance from another color.
func NearestColor ¶
NearestColor returns the nearest color, and distance from the given color.
Example ¶
// Pick a color close to IBM Blue blue := color.RGBA{84, 138, 196, 255} // Find the nearest color nearest := NearestColor(blue) // Print what we got fmt.Printf("%+v\n", nearest)
Output: &{Color:{Color:{R:90 G:135 B:197 A:255} Names:[IBM Blue]} RGBDistance:{R:6 G:-3 B:1}}
type RGBDistance ¶
type RGBDistance struct {
R, G, B int16
}
RGBDistance holds a signed distance of 8-bit RGB values to get from one color to another. Range: -255 through 255.
Click to show internal directories.
Click to hide internal directories.