Created
October 30, 2011 07:58
-
-
Save andyyou/1325684 to your computer and use it in GitHub Desktop.
colordiff
This file contains 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
color = ["ffffff","f9fcfe","eaf5fd","dbeefb","cce6f9","bddff7","add8f5","9ed0f4","8fc9f2","71baee","61b3ed","52abeb","43a4e9"] | |
color.inject do |f,s| | |
color = f.to_s | |
next_color = s.to_s | |
first = color[0,2].hex | |
second = color[2,2].hex | |
third = color[4,2].hex | |
next_color_first = next_color[0,2].hex | |
next_color_second = next_color[2,2].hex | |
next_color_third = next_color[4,2].hex | |
puts "#{first - next_color_first},#{second - next_color_second},#{third - next_color_third}" | |
next_color | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment