utils

package
v0.0.0-...-a4f0223 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddColorVariantsToPalette

func AddColorVariantsToPalette(palette *[]models.Pixel)

AddColorVariantsToPalette adds lighter or darker variants of the colors to the palette based on brightness.

func CalculateEuclideanDistance

func CalculateEuclideanDistance(x models.Pixel, y models.Pixel) float64

func CalculateMeanPixel

func CalculateMeanPixel(pixels []models.Pixel) models.Pixel

func CalculatePixelSum

func CalculatePixelSum(pixel models.Pixel) uint32

func ConvertRgbToAnsiBackground

func ConvertRgbToAnsiBackground(pixel models.Pixel) string

func ConvertRgbToHex

func ConvertRgbToHex(pixel models.Pixel) string

func FindMinimumDistanceIndex

func FindMinimumDistanceIndex(distances []float64) int

func GenerateDarkerPixelVariant

func GenerateDarkerPixelVariant(pixel models.Pixel) models.Pixel

func GenerateLighterPixelVariant

func GenerateLighterPixelVariant(pixel models.Pixel) models.Pixel

func GetPixels

func GetPixels(image image.Image) []models.Pixel

func InitializeRandomCentroids

func InitializeRandomCentroids(pixels []models.Pixel, numberOfClusters int) []models.Pixel

func SortPixelsByBrightness

func SortPixelsByBrightness(pixels []models.Pixel)

Types

This section is empty.

Jump to

Keyboard shortcuts

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