coloring

package
v0.0.0-...-414057b Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2020 License: Unlicense Imports: 4 Imported by: 0

Documentation

Overview

Package coloring contains utility functions useable when drawing any fractal.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Coloring

type Coloring struct {
	Grad iro.Gradient
	// contains filtered or unexported fields
}

Coloring contains information on how to color a fractal.

func NewColoring

func NewColoring(base iro.Color, mode Mode, colors []iro.Color, stops []float64) *Coloring

NewColoring pre-calculates gradients.

func (*Coloring) Get

func (c *Coloring) Get(i int64, it int64) (float64, float64, float64)

Get returns red, green and blue values from the current iteration i and the max iteration it.

func (*Coloring) Mode

func (c *Coloring) Mode() Mode

Mode returns the coloring mode.

func (*Coloring) String

func (c *Coloring) String() string

type Mode

type Mode int

Mode determines the coloring method.

const (
	// Modulo determines the coloring scheme based on the modulo of the iteration.
	Modulo Mode = iota
	// IterationCount determines the coloring scheme based on the length of the orbit.
	IterationCount
	// OrbitLength colors the orbit in a gradient from beginning to end.
	OrbitLength
	// VectorField colors the angles between the points in an orbit.
	VectorField
	// Path linearly interpolates between the points in the path.
	Path
)

func (Mode) String

func (m Mode) String() string

Jump to

Keyboard shortcuts

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