gocolorspicker

package
v0.0.0-...-47de3c1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 15, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeGif

func DecodeGif(path string) ([]*image.RGBA, []image.Rectangle, error)

func DecodeStatic

func DecodeStatic(path string) (*image.RGBA, image.Rectangle, error)

func DecodeWebp

func DecodeWebp(path string) ([]*image.RGBA, []image.Rectangle, error)

func FormConfigPath

func FormConfigPath(path string) string

func GetPixels

func GetPixels(path string) ([]map[colorful.Color]int, error)

func GetPixelsFromShot

func GetPixelsFromShot(rgba *image.RGBA, bounds image.Rectangle) map[colorful.Color]int

func MaxColor

func MaxColor(colors []colorful.Color, matches_map map[colorful.Color]int) colorful.Color

func Merge

func Merge(all_pixels map[colorful.Color]int, luft float64, need_colors int) map[colorful.Color]int

func SaveConfig

func SaveConfig(path string, config Configuration) error

func SaveJson

func SaveJson(path string, config []byte)

func SortByDistance

func SortByDistance(all_pixels map[colorful.Color]int) []colorful.Color

Types

type Cluster

type Cluster struct {
	Color   colorful.Color
	Matches int
}

func (*Cluster) ColorMerge

func (cluster *Cluster) ColorMerge(color colorful.Color, color_matches int)

type Color

type Color struct {
	Color   colorful.Color
	Matches int
}

type Configuration

type Configuration struct {
	Colors   []HexColor     `json:"all_colors"`
	Hyprland HyprlandConfig `json:"hyprland"`
	Eww      EwwConfig      `json:"eww"`
	Swaync   SwayncConfig   `json:"swaync"`
}

func GetConfig

func GetConfig(all_pixels map[colorful.Color]int) Configuration

type EwwConfig

type EwwConfig struct {
	MainColor      string `json:"main_color"`
	SecondaryColor string `json:"secondary_color"`
	TextColor      string `json:"text_color"`
	IconsColor     string `json:"icons_color"`
}

type HexColor

type HexColor struct {
	Color   string `json:"color"`
	Matches int    `json:"match"`
}

type HyprlandConfig

type HyprlandConfig struct {
	ActiveBorderColor1   string `json:"active_border_color_1"`
	ActiveBorderColor2   string `json:"active_border_color_2"`
	InactiveBorderColor1 string `json:"inactive_border_color_1"`
	InactiveBorderColor2 string `json:"inactive_border_color_2"`
}

type SwayncConfig

type SwayncConfig struct {
	MainColor      string `json:"main_color"`
	SecondaryColor string `json:"secondary_color"`
	TextColor      string `json:"text_color"`
	IconsColor     string `json:"icons_color"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL