Commit 11ec6d9c authored by Zach Knox's avatar Zach Knox

moved the colors to the css classes

parent 66a6ea80
......@@ -55,37 +55,37 @@
}
.degree0.mdl-card {
background-color: #000000;
background-color: #6b469c;
}
.degree10.mdl-card {
background-color: #222222;
background-color: #a0c9c1;
}
.degree20.mdl-card {
background-color: #444444;
background-color: #3ec2cf;
}
.degree30.mdl-card {
background-color: #666666;
background-color: #007dc5;
}
.degree40.mdl-card {
background-color: #777777;
background-color: #425195;
}
.degree50.mdl-card {
background-color: #888888;
background-color: #a39382;
}
.degree60.mdl-card {
background-color: #999999;
background-color: #ffcc33;
}
.degree70.mdl-card {
background-color: #aaaaaa;
background-color: #f7941e;
}
.degree80.mdl-card {
background-color: #bbbbbb;
background-color: #f37021;
}
.degree90.mdl-card {
background-color: #dddddd;
background-color: #ac1d37;
}
.degree100.mdl-card {
background-color: #ffffff;
background-color: #a62380;
}
.mdl-layout__tab-bar-right-button {
background-color: #006633;
......
//NOTES
//This file's main function will be called for each time of weather, evrey update.
//therefore this file needs to be optimiezed to be as fast as possible
//this is not implemented yet and just a proof of concept to start work
// will be implemented once we get live numbers to frontend
//HOW TO USE:
//Pass colorMain(type,deg);
//type(boolean) = farenheit or celcius
// true = farenheit
// false = celcius
//deg = degrees
//you will have a color in #111111 format returned
//main function
function colorMain(type,deg) {
if (type = true) {
return degToColor(deg);
} else {
return degToColor(convertToF(deg));
}
}
//deg needs to be farenheit
function degToColor(deg) {
switch (true) {
case deg < 10:
text = "#6b469c";
break;
case deg < 20:
text = "#a0c9c1";
break;
case deg < 30:
text = "#3ec2cf";
break;
case deg < 40:
text = "#007dc5";
break;
case deg < 50:
text = "#425195";
break;
case deg < 60:
text = "#a39382";
break;
case deg < 70:
text = "#ffcc33";
break;
case deg < 80:
text = "#f7941e";
break;
case deg < 90:
text = "#f37021";
break;
case deg < 100:
text = "#ac1d37";
break;
case deg > 100:
text = "#a62380";
break;
default:
text = "#F433FF";
}
return text;
}
function convertToF(CDeg){ //a possible widely used function
Fdeg = Cdeg*(9/5)+32;
return Fdeg;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment