shading

package
v0.0.0-...-77601ef Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ColorBlack = Color{0.0, 0.0, 0.0}

ColorBlack is a simple reference to an all-black Color

Functions

This section is empty.

Types

type Color

type Color struct {
	Red   float64 `json:"red"`
	Green float64 `json:"green"`
	Blue  float64 `json:"blue"`
}

Color is a light abstraction on a Vector, with translations to and from various representations from the core color library

func MakeColor

func MakeColor(c color.Color) Color

MakeColor creates a new shading.Color from a color.Color

func (Color) Add

func (c Color) Add(d Color) Color

Add adds values from two Colors together

func (Color) Clamp

func (c Color) Clamp(min, max float64) Color

Clamp clamps each component to a specified minimum and maximum

func (Color) DivColor

func (c Color) DivColor(d Color) Color

DivColor divides a Color by a Color component-wise

func (Color) DivScalar

func (c Color) DivScalar(s float64) Color

DivScalar divides a Color by a scalar

func (Color) MultColor

func (c Color) MultColor(d Color) Color

MultColor multiplies a Color by a Color component-wise

func (Color) MultScalar

func (c Color) MultScalar(s float64) Color

MultScalar multiplies a Color by a scalar

func (Color) Pow

func (c Color) Pow(e float64) Color

Pow raises a Color to an exponential power, component-wise

func (Color) Scale

func (c Color) Scale(s float64) Color

Scale scales all elements equally so the max channel is s

func (Color) ScaleDown

func (c Color) ScaleDown(s float64) Color

ScaleDown scales as Scale does, but only if the max channel is greater than s

func (Color) ScaleUp

func (c Color) ScaleUp(s float64) Color

ScaleUp scales as Scale does, but only if the max channel is lower than s

func (Color) ToRGBA

func (c Color) ToRGBA() color.RGBA

ToRGBA converts our Color into an RGBA representation from the color library

func (Color) ToRGBA64

func (c Color) ToRGBA64() color.RGBA64

ToRGBA64 converts our Color into an RGBA64 representation from the color library

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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