Skip to content

Instantly share code, notes, and snippets.

@andyyou
Created Oct 30, 2011
Embed
What would you like to do?
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