Skip to content

Commit

Permalink
Calendar events in different colors
Browse files Browse the repository at this point in the history
  • Loading branch information
reddragon committed Jul 6, 2010
1 parent fd86cdc commit d198a44
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/models/event.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
class Event < ActiveRecord::Base
has_event_calendar

def color
#You can add more colors, will be picked up uniformly
colors = ["#993333", "#003333", "#336600", "#996666", "#006666", \
"#336633", "#993366", "#660000", "#330066", "#003300"]
colors[id % colors.length]
end
end

0 comments on commit d198a44

Please sign in to comment.