Skip to content

Instantly share code, notes, and snippets.

@andyyou
Created October 30, 2011 07:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andyyou/1325684 to your computer and use it in GitHub Desktop.
Save andyyou/1325684 to your computer and use it in GitHub Desktop.
colordiff
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