Skip to content

Instantly share code, notes, and snippets.

View nanjizal's full-sized avatar
💭
On the edge

nanjizal nanjizal

💭
On the edge
View GitHub Profile
@hageldave
hageldave / BarycentricGradientPaint.java
Last active January 3, 2022 14:57
A java.awt.Paint implementation for triangular color interpolation (using barycentric coordinates). The svg file shows the result of the demo app (embedded image).
/* Copyright 2021 David Haegele - Source from JPlotter */
import java.awt.Color;
import java.awt.Paint;
import java.awt.PaintContext;
import java.awt.Rectangle;
import java.awt.RenderingHints;
import java.awt.Shape;
import java.awt.geom.AffineTransform;
import java.awt.geom.Point2D;