Skip to content

Instantly share code, notes, and snippets.

View sxua's full-sized avatar
🇺🇦

Oleksandr Skrypnyk sxua

🇺🇦
View GitHub Profile
@sxua
sxua / xcassets-export.rb
Last active July 29, 2021 20:30
Export colors from Xcode into CSV
require "csv"
require "json"
XCASSETS_NAME = "Colors.xcassets"
CSV.open(XCASSETS_NAME + ".csv", "wb") do |csv|
csv << ["Name", "Appearance", "HEX Value", "Alpha"]
Dir.glob(XCASSETS_NAME + "/**/*.colorset/Contents.json") do |file_name|
file = File.read(file_name)