PixelKit Demos

Polygonal Difference

pod 'PixelKit'
import PixelKit
view.backgroundColor = .black
        
PixelKit.main.bits = ._16

let res: PIX.Res = .fullscreen

let radius: LiveFloat = 0.125
let dist: LiveFloat = radius / 1.5
let cornerRadius: LiveFloat = radius / 2

let poly = PolygonPIX(res: res)
poly.radius = radius
poly.vertexCount = 6
poly.cornerRadius = cornerRadius

let blends = BlendsPIX.loop(6,
        blendMode: .difference) { (i, f) in
    return poly._rotatate(by: f)
               ._move(by: pointFrom(angle: f,
                                    radius: dist))
}

let finalPix = blends
finalPix.view.frame = view.bounds
view.addSubview(finalPix.view)
Created by Hexagons