Created
April 29, 2015 04:17
-
-
Save firedev/94f3cd8f5e7af2019e0f to your computer and use it in GitHub Desktop.
Ruby functional-style palette maker
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
require 'paleta' | |
colors = %w( 669900 66FF00 66CCFF 6699FF 6633FF ) | |
to_color = ->(color) { Paleta::Color.new(:hex, color) } | |
to_div = ->(color) { "<div style='width: 3em; height: 3em; background: ##{color}; float: left'></div>" } | |
puts colors.uniq.map(& to_color).sort_by(&:hue).map(&:hex).map(& to_div) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment