ColorMango
ColorMango is a Swift Package available for SwiftUI that can help give your Text views pop. The colors of characters or specified substrings will alternate between colors within the user’s set choice.
In its simplest form you enter 2 parameters, the string you want displayed and the color choice:
Mango(text: "Hello world!", colors: .rainbow)
ColorMango has 6 color choices, 5 preset ones and 1 called .custom() which allows for the user to enter their own array of Color to use:
Mango(text: "Hello world!", colors: .custom([.yellow, .purple]))
There are also 2 more optional parameters.
You can specify a String to act as the seperator to better clarify which substrings you would like colored:
Mango(text: "Hello world, this is ColorMango", colors: .rasta, separator: " ")
Lastly, you can specify the colors of the seperators with the same original color choices:
Mango(text: "Hello world, this is ColorMango", colors: .rasta, separator: "o", separatorColors: .custom([.purple]))