Repository navigation
Releases
Releases · h8gi/canvas
v0.5.0 - Animated GIF Export, Offscreen Graphics, Vector Math, FBM Noise & Easing
What's New in v0.5.0
✨ New Features
- Animated GIF Export (
RecordGIF): Automated animated GIF recording and exporting with configurable delay, loop count, and Floyd-Steinberg dithering (#24, #32). - Shape Primitives & Interpret Modes: Added
DrawPolygon,DrawStar,DrawSector,DrawCenteredRectangle,DrawCenteredSquare,RectMode, andEllipseModesupport (#25, #33). - 2D Vector Math Helpers: Intuitive vector operations including
VecAdd,VecSub,VecMult,VecDiv,VecMag,VecNormalize,VecLimit,VecSetMag,VecDist,VecDot,VecCross,VecRotate,VecAngleBetween, andVecLerp(#26, #34). - FBM Noise & Animation Easings: Multi-octave Fractal Brownian Motion (
NoiseFBM,NoiseFBM3D,NoiseFBM1D) and 27 standard animation easing functions ineasing.go(#27, #35). - Offscreen Graphics Buffers: Independent drawing contexts via
CreateGraphics/NewGraphicsand layer blitting withDrawGraphics/DrawGraphicsAnchored(#28, #36). - Mouse Scroll & Window Resizing: Trackpad/mouse wheel scrolling (
ctx.MouseScroll,c.MouseScrolled) and dynamic window resizing events (c.WindowResized) (#29, #37).
⚡ Performance
- Added
BenchmarkFlipVverifying zero heap allocations and ~25.3 GB/s throughput (~0.32 ms for full HD 1080p frame) (#30, #38).
🎨 Examples & Documentation
- Added
examples/gif-export: Automated animated GIF recording and exporting demo. - Added
examples/boids: Craig Reynolds' flocking simulation using vector math. - Added
examples/particle-system: Physics-based particle fountain with quadratic/cubic easings and offscreen trail layer. - Added
examples/fractal-tree: Organic branching tree animated with 1D Perlin noise wind sway. - Updated
README.mddocumentation and examples index.
v0.4.0 - Processing Primitives, Vertex Paths, Gaussian Randomness & Frame Sequences
Highlights
🔺 Shape Primitives & Custom Vertex Paths
- Primitives: Added
ctx.DrawSquare(x, y, s),ctx.DrawTriangle(...), andctx.DrawQuad(...). - Custom Shapes: Added
ctx.BeginShape(),ctx.Vertex(x, y), andctx.EndShape(close bool).
🎲 Math & Vector Extensions
- Gaussian Distribution: Added
canvas.RandomGaussian(mean, stdDev)andcanvas.RandomSeed(seed). - 2D Vector Math: Added
canvas.FromAngle(rad),canvas.Random2D(), andcanvas.Heading(v). - Pixel Sampling: Added
ctx.GetPixel(x, y)andctx.SetPixelColor(x, y, c).
🎞️ Frame Sequence Export
- Added
ctx.SaveFrameSeq("frames/frame_%04d.png")with automatic parent directory creation.
v0.3.0 - Color Utilities, Event Callbacks & Visual Showcase
Highlights
🎨 Color Utilities & Models
- HSB / HSL: Added
canvas.HSB(h, s, b),HSBA,HSL,HSLAfor intuitive color picking. - Color Helpers: Added
canvas.RGB(...),canvas.RGBA(...), andcanvas.Hex("#hex"). - Interpolation: Added
canvas.LerpColor(c1, c2, amt). - Context Shortcuts:
ctx.FillHSB(),ctx.StrokeHSB(),ctx.BackgroundHSB(), etc.
⌨️ Processing-Style Event Callbacks
- Added
c.KeyPressed(...)/c.KeyReleased(...) - Added
c.MousePressed(...)/c.MouseReleased(...) - Added
c.MouseMoved(...)
🖼️ New Showcase & Example
- Added
examples/flow-field: 2D Perlin noise particle flow field with HSB spectrum trails. - Added visual showcase previews to
README.md.
v0.2.1 - Add MIT License & Examples READMEs
Highlights
- Added official MIT License file to resolve
pkg.go.devdocumentation license policy restrictions. - Added comprehensive and concise
README.mdfiles to all example projects inexamples/. - Fixed
NoLoop()to ensure the first frame always renders before pausing.
v0.2.0 - Modernization & Creative Coding Features
Highlights
🚀 Modernization & Quality
- Upgraded to modern Go modules and
gopxl/pixel/v2(v2.3.0). - Cross-platform GitHub Actions CI matrix for Linux, macOS, and Windows.
- Comprehensive unit tests and GoDoc documentation.
🎨 Creative Coding & Processing-like Features
- Perlin Noise: Built-in
canvas.Noise(x, y, z),Noise2D,Noise1D, andNoiseSeed. - Default Font: Out-of-the-box text drawing with
ctx.DrawStringwithout explicit font setup. - Convenience Methods:
ctx.Background(...),ctx.FillHex(...),ctx.StrokeHex(...),ctx.FillRGB(...),ctx.NoFill(),ctx.NoStroke(), andctx.SaveFrame(...). - Time & Frame Tracking:
ctx.FrameCount,ctx.DeltaTime,ctx.Time. - Math Utilities:
canvas.Map,canvas.Lerp,canvas.Constrain,canvas.Dist,canvas.Random,canvas.Radians,canvas.Degrees. - Loop Control:
c.NoLoop(),c.Loop(),c.Redraw(),c.IsLooping(). - Window Configuration:
ResizableandFullscreensupport inCanvasConfig.
🐛 Bug Fixes
- Fixed vertical coordinate system mismatch between
ggand OpenGL, resolving upside-down text rendering and aligning mouse coordinates with Processing standards (#6).