Created
November 8, 2011 11:40
-
-
Save golgote/1347562 to your computer and use it in GitHub Desktop.
Use palette.pl in TextMate to output colors used in a CSS file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Palette is a Perl tool that creates a color swatch from a CSS file | |
# http://code.google.com/p/css-palette/source/browse/trunk/src/palette.pl | |
require ENV["TM_SUPPORT_PATH"] + "/lib/tm/executor" | |
require ENV["TM_SUPPORT_PATH"] + "/lib/tm/save_current_document" | |
palette = ENV["TM_BUNDLE_SUPPORT"] + "/palette.pl" | |
TextMate.save_current_document | |
TextMate::Executor.make_project_master_current_document | |
TextMate::HTMLOutput.show(:window_title => "Palette", :page_title => "Palette", :sub_title => "#{ENV["TM_FILEPATH"]}") do |io| | |
io << TextMate::Process.run(palette, "--src=#{ENV["TM_FILEPATH"]}") | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment