Improved terminal feedback

This commit is contained in:
Devine Lu Linvega
2017-03-17 15:29:47 -07:00
parent ed5702beee
commit e7307f7bdd
9 changed files with 53 additions and 32 deletions

View File

@@ -29,4 +29,14 @@ function Color(hex = '#000000')
{
return "#"+("0" + parseInt(rgb[0],10).toString(16)).slice(-2)+("0" + parseInt(rgb[1],10).toString(16)).slice(-2)+("0" + parseInt(rgb[2],10).toString(16)).slice(-2);
}
this.brightness = function()
{
return this.rgb() ? (this.rgb().r + this.rgb().g + this.rgb().b)/3 : 0;
}
this.style = function()
{
return this.brightness() > 150 ? "bright" : "dark";
}
}