Documentation ¶
Overview ¶
Package color provides general utilities for image/color objects and color codes.
Index ¶
- func CreateImage(clr *color.RGBA, xSize, ySize int) (*bytes.Buffer, error)
- func FromHex(hexVal string) (*color.RGBA, error)
- func GetVibrantColorFromImage(img image.Image) (clr int, err error)
- func GetVibrantColorFromImageUrl(url string) (clr int, err error)
- func ToHex(clr *color.RGBA) string
- func ToInt(clr *color.RGBA) int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateImage ¶
CreateImage generates a PNG image filled with the passed color in the size of the passed xSize and ySize dimensions.
The generated image is returned as bytes.Buffer reference. When the image generation fails, an error is returned.
func FromHex ¶
FromHex returns a color.RGBA object reference from the passed hexVal HEX RGBA color code.
When the passed color code is malformed, an error is returned.
func GetVibrantColorFromImage ¶
GetVibrantColorFromImage returns the vribrant accent color of an image passed.
func GetVibrantColorFromImageUrl ¶
GetVibrantColorFromImageUrl requests the image from the given URL and returns the vribrant accent color of an image passed.
Types ¶
This section is empty.