let gradientNumber = Int.random(in: 0..gradients.count)
let selectedGradient = gradients[gradientNumber]
selectedGradient?.size = .init(width: screenWidth, height: screenHeight)
label.textColor = NSColor (patternImage: selectedGradient!)
view.setNeedsDisplay(viewSize)
This is the code that applies the text colour, .tile wouldn't work properly because it's a gradient not a flat colour.
cheers.
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: