Skip to content

Latest commit

 

History

History
38 lines (27 loc) · 760 Bytes

README.md

File metadata and controls

38 lines (27 loc) · 760 Bytes

Chris's SwiftUI Chromatic Aberration

A View Modifier to shift colour

Overview

import SwiftUI
import ChromaticAberration~

struct ExampleSwiftUIView {}

extension ExampleSwiftUIView: View {
  
  var body: some View {
    content
      .padding(4)
  }
  
  var content: some View {
    HStack {
      Image("craig", bundle: Bundle.module)
      Text("Craig")
        .foregroundColor(Color.red)
    }
    .padding(10)
    .background(Color.green)
    .chromaticAberration(red: CGPoint(x: 10, y: 4))
  }
  
}

Before After
Before After