@@ -61,7 +61,7 @@ final class Generator {
61
61
case " SOLID " :
62
62
output. append ( getRenderedSolid ( from: styles) )
63
63
case " GRADIENT_LINEAR " , " GRADIENT_ANGULAR " :
64
- output. append ( getRenderedGradient ( from: styles) )
64
+ output. append ( getRenderedGradient ( from: styles, type : . uiColor ) )
65
65
default :
66
66
prettyPrint ( " Error with style - \( style) " )
67
67
}
@@ -197,7 +197,7 @@ final class Generator {
197
197
return output
198
198
}
199
199
200
- private func getRenderedGradient( from dict: [ String : Any ] ) -> String {
200
+ private func getRenderedGradient( from dict: [ String : Any ] , type : ColorType ) -> String {
201
201
var newdict = dict
202
202
guard let colors = dict [ " colors " ] as? [ [ String : Any ] ] else {
203
203
prettyPrint ( " Error with colors in \( dict) " )
@@ -210,9 +210,11 @@ final class Generator {
210
210
if index != colors. endIndex- 1 {
211
211
value [ " separator " ] = " , "
212
212
}
213
- colorsRaw. append ( getColor ( from: value, withType: . uiColor ) )
213
+ colorsRaw. append ( getColor ( from: value, withType: type ) )
214
214
}
215
215
colorsRaw. indices. last. map { colorsRaw [ $0] = String ( colorsRaw [ $0] . dropLast ( 1 ) ) }
216
+
217
+ newdict [ " type " ] = type. rawValue
216
218
newdict [ " colors " ] = colorsRaw
217
219
newdict [ " positions " ] = ( dict [ " positions " ] as! [ String ] ) . joined ( separator: " , " )
218
220
let context = Context ( dictionary: newdict)
0 commit comments