1.0.1 • Published 10 months ago

swift-gradient v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

Swift Gradient

Gradient Example

const PURPLE = "#a960ee";
const RED = "#ff333d";
const CYAN = "#90c0ff";
const ORANGE = "#ffcb57";

const gradientMeshConfig = {
  width: 3,
  height: 3,
  points: [
    [0.0, 0.0], [0.5, 0.0], [1.0, 0.0],
    [0.0, 0.5], [0.5, 0.5], [1.0, 0.5],
    [0.0, 1.0], [0.5, 1.0], [1.0, 1.0],
  ],
  colors: [
    PURPLE, ORANGE, PURPLE,
    ORANGE, ORANGE, PURPLE,
    CYAN, PURPLE, PURPLE,
  ],
};

const canvas = document.getElementById("default");
renderGradientMesh(gradientMeshConfig, canvas);
1.0.1

10 months ago

1.0.0

10 months ago