coloursorting

package module
v0.0.0-...-8cdd48e Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: MIT Imports: 1 Imported by: 1

README

coloursorting

GoDoc

A simple Go package for sorting a slice of colours in a visually pleasing way.

A large part of the credit goes to Alan Zucconi's colour sorting blog post.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StepSort

type StepSort [][3]int

StepSort implements a roughly hue-based colour sorting algorithm based on the "Step Sorting" section from https://www.alanzucconi.com/2015/09/30/colour-sorting/.

func (StepSort) Len

func (a StepSort) Len() int

Len simply retrieves the length of the slice.

func (StepSort) Less

func (a StepSort) Less(i, j int) bool

Less determines whether the element at i is less than the element at j.

func (StepSort) Swap

func (a StepSort) Swap(i, j int)

Swap swaps the elements at i and j.

Jump to

Keyboard shortcuts

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