Skip to content

Instantly share code, notes, and snippets.

@christocracy
Created April 26, 2010 17:34
Show Gist options
  • Save christocracy/379633 to your computer and use it in GitHub Desktop.
Save christocracy/379633 to your computer and use it in GitHub Desktop.
desc "modulate <theme> <hue> <saturation> <lightness>", "Modulate a theme. Specify h, s, l as floats, eg: 1.5"
def modulate(theme, hue, saturation, lightness)
ExtJS::Theme.each_image {|img|
path = img.filename.split('/')
filename = path.pop
dir = path.pop
say_status("modulate", File.join(dir, filename))
ExtJS::Theme.write_image(img.modulate(lightness.to_f, saturation.to_f, hue.to_f), File.join(ExtJS::Theme["theme_dir"], theme))
}
gsub_file(File.join(ExtJS::Theme["theme_dir"], theme, "defines.sass"), /\$hue:\s?(.*)/, "$hue: #{(hue.to_f-1)*180}")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment