add Ox.Theme.formatColorPercent

This commit is contained in:
rolux 2012-10-05 14:14:58 +02:00
parent dc03bb506a
commit 86a3e50ed6

View file

@ -139,6 +139,16 @@ Ox.Theme = (function() {
.html(values[+index]); .html(values[+index]);
}; };
/*@
formatColorPercent <f> Returns a themed colored element
@*/
that.formatColorPercent = function(value, decimals, sqrt) {
var hue = (sqrt ? Math.sqrt(value) * 10 : value) * 1.2;
return renderElement(hue, 'gradient')
.css({textAlign: 'center'})
.html(Ox.formatNumber(value, decimals) + '%')
};
/*@ /*@
getColorImage <f> Returns a themed colored image getColorImage <f> Returns a themed colored image
@*/ @*/