2012-03-15 08:53:26 +00:00
|
|
|
desc 'Generate color palettes'
|
|
|
|
task :gen_color_palettes do
|
|
|
|
require 'yaml'
|
|
|
|
|
|
|
|
default = YAML.load_file('config/colors/default.yml')
|
|
|
|
rgb = YAML.load_file('config/colors/rgb.yml')
|
|
|
|
colors = default.merge(rgb)
|
|
|
|
|
|
|
|
out = ""
|
|
|
|
|
|
|
|
colors.each do |n, value|
|
|
|
|
out << ".fg#{n} { color: #{value} }\n"
|
|
|
|
out << ".bg#{n} { background-color: #{value} }\n"
|
|
|
|
end
|
|
|
|
|
|
|
|
File.open('app/assets/stylesheets/colors.css', 'w') { |f| f.write out }
|
|
|
|
|
|
|
|
File.open('app/assets/javascripts/player/colors.js', 'w') do |f|
|
2013-09-23 17:05:36 +00:00
|
|
|
f.write "Asciinema.colors = #{JSON.dump(colors)};"
|
2012-03-15 08:53:26 +00:00
|
|
|
end
|
|
|
|
end
|