I'm trying to make an app that'll suggest a color based on a keyword the user inputs. I store prediction from the model to a [String: Double]
array and then compute the output color. However, I'm stuck on two strange errors.
Here's my code:
extension Array where Element == [String: Double]{
func average() -> RGBList{
var returnValue = (r: 0, g: 0, b: 0)
var r = 0
var g = 0
var b = 0
for key in self{
r = Int(key[0].split(",")[0]) * key[1]
...
}
...
}
}