stephancasas / SwiftUIColorizedControlExample

Color-accurate control tint overrides for SwiftUI macOS applications.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SwiftUI Colorized Control Example

This repository provides an example implementation of using CoreImage filters with custom NSViewRepresentable implementations of macOS AppKit controls to achieve color-accurate control tint variations.

The CIFilter implemented is a color cube-type filter which wholesale overrides the lookup value of every color required to draw a control's layer. As color values are overriden to their exact specification, this approach is advantageous over using a hue rotation or other similar filter.

A SwiftUI ProgressView and AppKit NSProgressIndicatorthe first being adjusted via the .tint(:) modifier and the latter being adjusted via a custom CIFilter.

Say Hi

Follow Stephan on Twitter

License

MIT

About

Color-accurate control tint overrides for SwiftUI macOS applications.


Languages

Language:Swift 100.0%