Repeating gradient
We could add easily repeating gradient
We can find the concept in css https://www.w3schools.com/cssref/tryit.asp?filename=trycss3_gradient-linear_repeating2 https://developer.apple.com/library/content/documentation/InternetWeb/Conceptual/SafariVisualEffectsProgGuide/Gradients/Gradient.html
We need for that the number of repetitions
We could add parameter to the GradientMode or I prefer to add a var in GradientDesignable
For Linear it is very easy
let layer = CAGradientLayer()
layer.colors = colors.aFunctionToDuplicate(numberOfRepeat: 5)
For radial, same things and also an adaptation must be done when computing locations (now it is [0, 1])
I try with that but not sure that we must do that
var locations: [CGFloat] = []
let size: CGFloat = 1 / CGFloat(colors.count)
var pos: CGFloat = 0
for _ in 0..<colors.count {
locations.append( pos)
pos += size
}
locations.append(1)

TIL, great idea. I prefer to add an associated value to the enum since we provide similar API for Animtable and some other properties. But we need to handle the parsing careful to apply default 1 to not break the existing @IBInspectable var _gradientMode: String?.
@tbaranes any idea on the API interface?
New idea, when repeating have an odd numbers of colors, with last colors same as first colors See #567 for smooth conic gradient