lang

package
v0.0.0-...-fbe25eb Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Boolean

type Boolean bool

Boolean is the type used to express booleans

var FalseVal Boolean = false

FalseVal is the Boolean false

var TrueVal Boolean = true

TrueVal is the Boolean false

type Color

type Color struct {
	R Number
	G Number
	B Number
	A Number
}

Color represents a color with RGBA channels, each channel value held as a floating-point number with range 0..255. This range can be exceeded as a result of a computation.

func NewRgba

func NewRgba(r Number, g Number, b Number, a Number) Color

NewRgba creates a Color from r,g,b,a channel values.

func NewSrgba

func NewSrgba(scr Number, scg Number, scb Number, sca Number) Color

NewSrgba creates a Color from r,g,b,a channel values which are normalized to the range 0..1.

func (Color) Clamp

func (c Color) Clamp() Color

Clamp returns a Color with all channel values clamped to 0..255

func (Color) Intensity

func (c Color) Intensity() Number

Intensity returns the brightness of a color normalized to 0..255.

func (Color) ScA

func (c Color) ScA() Number

ScA returns the alpha value normalized to 0..1

func (Color) ScB

func (c Color) ScB() Number

ScB returns the blue channel value normalized to 0..1

func (Color) ScG

func (c Color) ScG() Number

ScG returns the green channel value normalized to 0..1

func (Color) ScIntensity

func (c Color) ScIntensity() Number

ScIntensity returns the brightness of a color normalized to 0..1

func (Color) ScR

func (c Color) ScR() Number

ScR returns the red channel value normalized to 0..1

type Nil

type Nil struct{}

Nil is the type used to express the absence of a value

var NilVal Nil = Nil{}

NilVal is the only value a Nil type can have

type Number

type Number float32

Number is the number type used by the interpreter

const (
	MinNumber Number = Number(math.MinInt64)
	MaxNumber Number = Number(math.MaxInt64)
)

Number constants

func (Number) Clamp

func (n Number) Clamp() Number

Clamp clamps a number to the range of 0..255

type Str

type Str string

Str is used to express strings

Jump to

Keyboard shortcuts

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