Last active
August 30, 2020 00:38
-
-
Save laevandus/12412ff13423c2822cb3ebc427348d89 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ColorContrastRatio | |
import SwiftUI | |
struct ContentView: View { | |
var body: some View { | |
VStack { | |
Text("Luminance for red color").padding() | |
Rectangle() | |
.frame(width: 50, height: 50) | |
.fixedSize() | |
.foregroundColor(.red) | |
Text("\(UIColor.red.relativeLuminance)") | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment