Created
April 24, 2024 13:57
-
-
Save atebit/0f9fc1418fc97cc7c8f27e6f17a186f9 to your computer and use it in GitHub Desktop.
Swift Color Contrast Algo
This file contains hidden or 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
| func exportColor(flags: Int) { | |
| if !(flags & leaveValue != 0) && valueElement != nil { | |
| // Implement your logic for handling valueElement | |
| } | |
| var value = toString() | |
| if caps { | |
| value = value.uppercased() | |
| } | |
| if hash { | |
| value = "#" + value | |
| } | |
| valueElement?.value = value | |
| if !(flags & leaveStyle != 0) && styleElement != nil { | |
| styleElement?.style.backgroundImage = "none" | |
| styleElement?.style.backgroundColor = "#" + toString() | |
| let color = (0.213 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment