Skip to content

Commit

Permalink
Keep randomly assigned colors light
Browse files Browse the repository at this point in the history
  • Loading branch information
relaxdiego committed Jul 29, 2010
1 parent b0a48f3 commit 3aa5a98
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/backlogs_user_patch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ def backlogs_preference(attr, set_to = nil)
if !v && (!set_to || set_to == '')
colors = UserPreference.find(:all).collect{|p| p[prefixed].to_s.upcase}.select{|p| p != ''}
50.times do
set_to = "##{rand(0xFFFFFF).to_s(16).upcase}"
min = 0x999999
set_to = "##{(min + rand(0xFFFFFF-min)).to_s(16).upcase}"
break unless colors.include?(set_to)
end
end
Expand Down

0 comments on commit 3aa5a98

Please sign in to comment.