README
texture.js
<canvas id="texture"></canvas>
<script src="https://heestand-xyz.github.io/texture.js/texture.js"></script>
var canvas = document.getElementById("texture")
Circle
var circleTex = new CircleTEX(canvas)
circleTex.position = new Position(0.0, 0.0)
circleTex.radius = 0.25
Docs for CircleTEX
Polygon
var polygonTex = new PolygonTEX(canvas)
polygonTex.vertexCount = 3
polygonTex.radius = 1.0 / 3.0
polygonTex.cornerRadius = 0.05
Docs for PolygonTEX
Noise
var noiseTex = new NoiseTEX(canvas);
noiseTex.octaves = 2
noiseTex.scale = 1.5
Docs for NoiseTEX
Gradient
var gradientTex = new GradientTEX(canvas);
gradientTex.direction = GradientDirection.vertical
gradientTex.scale = 1.0
gradientTex.colorStops = [
new GradientColorStop(0.0, Color.black),
new GradientColorStop(1.0, Color.white)
]
Docs for GradientTEX