pattern

package
v0.0.0-...-8cfed74 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AtObject

func AtObject(p Pattern, o Object, point tuple.Tuple) *color.Color

AtObject returns the color of a stripe at a point on an object

Types

type Checkers

type Checkers struct {
	Transform *matrix.Matrix
	// contains filtered or unexported fields
}

Checkers pattern

func NewCheckers

func NewCheckers(a color.Color, b color.Color) *Checkers

NewCheckers returns a checkers pattern

func (*Checkers) GetTransform

func (p *Checkers) GetTransform() *matrix.Matrix

GetTransform returns a checkers transformation matrix

func (*Checkers) PatternAt

func (p *Checkers) PatternAt(point tuple.Tuple) *color.Color

PatternAt returns the color of a gradient at a point

func (*Checkers) SetTransform

func (p *Checkers) SetTransform(m *matrix.Matrix)

SetTransform sets a checkers transformation matrix

type Gradient

type Gradient struct {
	Transform *matrix.Matrix
	// contains filtered or unexported fields
}

Gradient pattern

func NewGradient

func NewGradient(a color.Color, b color.Color) *Gradient

NewGradient returns a gradient pattern

func (*Gradient) GetTransform

func (p *Gradient) GetTransform() *matrix.Matrix

GetTransform returns a gradient's transformation matrix

func (*Gradient) PatternAt

func (p *Gradient) PatternAt(point tuple.Tuple) *color.Color

PatternAt returns the color of a gradient at a point

func (*Gradient) SetTransform

func (p *Gradient) SetTransform(m *matrix.Matrix)

SetTransform sets a gradient's transformation matrix

type Object

type Object struct {
	Transform *matrix.Matrix
}

Object struct

func NewObject

func NewObject() Object

NewObject returns a new object

func (*Object) SetTransform

func (o *Object) SetTransform(transform *matrix.Matrix)

SetTransform sets an object's transform

type Pattern

type Pattern interface {
	GetTransform() *matrix.Matrix
	SetTransform(m *matrix.Matrix)
	PatternAt(point tuple.Tuple) *color.Color
}

Pattern interface

type RadialGradient

type RadialGradient struct {
	Transform *matrix.Matrix
	// contains filtered or unexported fields
}

RadialGradient pattern

func NewRadialGradient

func NewRadialGradient(a color.Color, b color.Color) *RadialGradient

NewRadialGradient returns a radial gradient pattern

func (*RadialGradient) GetTransform

func (p *RadialGradient) GetTransform() *matrix.Matrix

GetTransform returns a radian gradient transformation matrix

func (*RadialGradient) PatternAt

func (p *RadialGradient) PatternAt(point tuple.Tuple) *color.Color

PatternAt returns the color of a radial gradient at a point

func (*RadialGradient) SetTransform

func (p *RadialGradient) SetTransform(m *matrix.Matrix)

SetTransform sets a radial gradient's transformation matrix

type Ring

type Ring struct {
	Transform *matrix.Matrix
	// contains filtered or unexported fields
}

Ring pattern

func NewRing

func NewRing(a color.Color, b color.Color) *Ring

NewRing returns a gradient pattern

func (*Ring) GetTransform

func (p *Ring) GetTransform() *matrix.Matrix

GetTransform returns a gradient's transformation matrix

func (*Ring) PatternAt

func (p *Ring) PatternAt(point tuple.Tuple) *color.Color

PatternAt returns the color of a gradient at a point

func (*Ring) SetTransform

func (p *Ring) SetTransform(m *matrix.Matrix)

SetTransform sets a gradient's transformation matrix

type Stripe

type Stripe struct {
	Transform *matrix.Matrix
	// contains filtered or unexported fields
}

Stripe pattern

func NewStripe

func NewStripe(a color.Color, b color.Color) *Stripe

NewStripe returns a stripe pattern

func (*Stripe) GetTransform

func (p *Stripe) GetTransform() *matrix.Matrix

GetTransform returns a stripe's transformation matrix

func (*Stripe) PatternAt

func (p *Stripe) PatternAt(point tuple.Tuple) *color.Color

PatternAt returns the color of a stripe at a point

func (*Stripe) SetTransform

func (p *Stripe) SetTransform(m *matrix.Matrix)

SetTransform sets a stripe's transformation matrix

Jump to

Keyboard shortcuts

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