Skip to content

Latest commit

 

History

History
86 lines (60 loc) · 3.46 KB

README.md

File metadata and controls

86 lines (60 loc) · 3.46 KB

MeshKit

A powerful and easy to use live mesh gradient renderer for iOS, living branch of archived EthanLipnik's MeshKit

This project wouldn't be possible without the awesome work from Moving Parts and their Swift Playground

What is MeshKit?

MeshKit is an easy to use live mesh gradient renderer for iOS. In just a few lines of code, you can create a mesh gradient.

Usage

Quickstart

    private let randomizer = MeshRandomizer(colorRandomizer: { _, _, _, _, _, _ in
        return
    })
    private let colors: MeshColorGrid = MeshKit.generate(palette: Hue.purple, size: MeshSize(width: 4, height: 4))

    public var grainAlpha: Float = MeshDefaults.grainAlpha
    public var subdivisions: Float = Float(MeshDefaults.subdivisions)
    public var colorSpace: CGColorSpace?

    public var body: some View {
        ZStack {
            Mesh(colors: colors,
                 animatorConfiguration: .init(meshRandomizer: randomizer),
                 grainAlpha: grainAlpha,
                 subdivisions: Int(subdivisions),
                 colorSpace: colorSpace)
            .edgesIgnoringSafeArea(.all)

            VStack {
            }<