artemnovichkov/zepcode

Saving color palette doesn't work

artemnovichkov opened this issue · 2 comments

Version of Zepcode:

0.5.0

Generated snippet:

import UIKit

extension UIColor {

    convenience init(r red: Int, g green: Int, b blue: Int, a: CGFloat = 1) {
        self.init(red: CGFloat(red) / 255, green: CGFloat(green) / 255, blue: CGFloat(blue) / 255, alpha: a)
    }

    static let dodgerBlue = UIColor(red: 72/255, green: 171/255, blue: 255/255, alpha: 1)
    
}

What's wrong:

Can't save snippet into file.

It crashes since the second argument of generateColorExtension is missing here:

zepcode/src/index.js

Lines 103 to 105 in 6eecca3

function exportStyleguideColors(context, colors) {
return generateColorExtension(colors);
}

I guess options(context) is also required for this function to run properly.

@dirtybit, you're right! Thank you!