Created
January 6, 2014 09:41
-
-
Save emirikol/8280403 to your computer and use it in GitHub Desktop.
Revisions
-
emirikol created this gist
Jan 6, 2014 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ def back_and_fore_color(color) rgb = color.sub('#','').scan(/../).map {|c| c.to_i(16)} fore_color = rgb.sum > 384 ? 'black' : 'white' "background-color:#{color};color:#{fore_color};" end