A bit more useful color-coding

This commit is contained in:
Tyler Renelle 2012-02-06 14:25:18 -05:00
parent 1a13a5f0aa
commit c86471f708
2 changed files with 14 additions and 13 deletions

View file

@ -2,14 +2,13 @@
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
.bad, .bad a{
background-color:rgb(224, 102, 102);
color:white !important;
}
.iffy { background-color:rgb(246, 178, 107); }
.ok { background-color:rgb(255, 217, 102); }
.good { background-color:rgb(147, 196, 125); }
.done { background-color:rgb(201, 218, 248); }
.color-red { background-color: rgb(230, 184, 175); }
.color-pink { background-color: rgb(244, 204, 204); }
.color-orange { background-color: rgb(252, 229, 205); }
.color-yellow { background-color: rgb(255, 242, 204); }
.color-green { background-color: rgb(217, 234, 211); }
.color-light-blue { background-color: rgb(208, 224, 227); }
.color-blue { background-color: rgb(201, 218, 248); }
.panel {
vertical-align:top;

View file

@ -11,11 +11,13 @@ module HabitsHelper
def score_color(habit)
s = habit.score
case
when s<-5 then return 'bad'
when s>=-5 && s<0 then return 'iffy'
when s>=0 && s<5 then return 'ok'
when s>=5 && s<15 then return 'good'
when s>=15 then return 'done'
when s<-8 then return 'color-red'
when s>=-8 && s<-4 then return 'color-pink'
when s>=-4 && s<0 then return 'color-orange'
when s>=0 && s<1.5 then return 'color-yellow'
when s>=1.5 && s<5 then return 'color-green'
when s>=5 && s<10 then return 'color-light-blue'
when s>=10 then return 'color-blue'
end
end