rect

package module
v0.0.0-...-6594e58 Latest Latest
Warning

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

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

README

go-rect

Package rect provides types that represents a rectangle filled in with a single color at a specific location, that seamlessly works with Go's built-in "image", "image/color", and "image/draw" packages.

Example

Here is an example of usage:

import "github.com/reiver/go-rect"

// ...

rectangle := rect.RGBA{
	X:x,
	Y:y,

	Width:width,
	Height:height,

	R: r,
	G: g,
	B: b,
	A: a,
}

// ...

draw.Draw(dst, rectangle.Bounds(), rectangle, rectangle.Bounds().Min, draw.Over)

Documention

Online documentation, which includes examples, can be found at: http://godoc.org/github.com/reiver/go-rect

GoDoc

See Also

For other useful Go packages that seamlessly works with Go's built-in "image", "image/color", and "image/draw" packages, also see:

Documentation

Overview

Package rect provides types that represents a rectangle filled in with a single color at a specific location, that seamlessly works with Go's built-in "image", "image/color", and "image/draw" packages.

Example

Here is an example of usage:

import "github.com/reiver/go-rect"

// ...

rectangle := rect.RGBA{
	X:x,
	Y:y,

	Width:width,
	Height:height,

	R: r,
	G: g,
	B: b,
	A: a,
}

// ...

draw.Draw(dst, rectangle.Bounds(), rectangle, rectangle.Bounds().Min, draw.Over)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ColorLinked

type ColorLinked struct {
	X int
	Y int

	Width  int
	Height int

	Color color.Color
}

func (ColorLinked) At

func (receiver ColorLinked) At(x, y int) color.Color

func (ColorLinked) Bounds

func (receiver ColorLinked) Bounds() image.Rectangle

func (ColorLinked) ColorModel

func (receiver ColorLinked) ColorModel() color.Model

func (ColorLinked) RGBA

func (receiver ColorLinked) RGBA() (r, g, b, a uint32)

type RGBA

type RGBA struct {
	X int
	Y int

	Width  int
	Height int

	R uint8
	G uint8
	B uint8
	A uint8
}

func (RGBA) At

func (receiver RGBA) At(x, y int) color.Color

func (RGBA) Bounds

func (receiver RGBA) Bounds() image.Rectangle

func (RGBA) ColorModel

func (receiver RGBA) ColorModel() color.Model

func (RGBA) RGBA

func (receiver RGBA) RGBA() (r, g, b, a uint32)

Jump to

Keyboard shortcuts

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