Documentation ¶
Overview ¶
Graphics related stuff
Implements badly some image drawing methods. Mainly used for debugging for now.
Example code:
canvas := gx.NewCanvas(300, 300) canvas.Clear(gx.BLACK) canvas.DrawCircle(100,100,50,10,gx.WHITE) canvas.DrawDisk(150,150,30,gx.RED) canvas.ToPNG("test.png")
Index ¶
- Variables
- func Abs(x int) int
- func Max(x, y int) int
- func Min(x, y int) int
- type Canvas
- func (c Canvas) Clear(color Color)
- func (c Canvas) DrawCircle(cx, cy, radius, border float32, color Color)
- func (c Canvas) DrawDisk(cx, cy, radius float32, color Color)
- func (c Canvas) DrawLine(start, end Vec2i, color Color)
- func (c Canvas) DrawPoint(x, y int, color Color)
- func (c Canvas) DrawRect(lowerLeft, upperRight Vec2i, color Color)
- func (c Canvas) ToPNG(file_path string)
- type Color
- type Vec2i
Constants ¶
This section is empty.
Variables ¶
View Source
var ( BLACK = color.NRGBA{R: 0, G: 0, B: 0, A: 255} WHITE = color.NRGBA{R: 255, G: 255, B: 255, A: 255} RED = color.NRGBA{R: 255, G: 0, B: 0, A: 255} GREEN = color.NRGBA{R: 0, G: 255, B: 0, A: 255} BLUE = color.NRGBA{R: 0, G: 0, B: 255, A: 255} ORANGE = color.NRGBA{R: 255, G: 165, B: 0, A: 255} SKYBLUE_PALE = color.NRGBA{204, 255, 255, 255} SKYBLUE_OPAQUE = color.NRGBA{128, 204, 204, 255} SKYBLUE = color.NRGBA{178, 255, 255, 255} )
Functions ¶
Types ¶
type Canvas ¶
func (Canvas) DrawCircle ¶
type Color ¶
func ParaRamp ¶
index 0 to 255 gives a whatever map cheap remake of https://www.kennethmoreland.com/color-advice/ ordered on wish
Click to show internal directories.
Click to hide internal directories.