From 86a3e50ed63813272b231a9274fd8bfff28041a3 Mon Sep 17 00:00:00 2001 From: rolux Date: Fri, 5 Oct 2012 14:14:58 +0200 Subject: [PATCH] add Ox.Theme.formatColorPercent --- source/Ox.UI/js/Core/Theme.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/source/Ox.UI/js/Core/Theme.js b/source/Ox.UI/js/Core/Theme.js index 1be3ddc7..8436419a 100644 --- a/source/Ox.UI/js/Core/Theme.js +++ b/source/Ox.UI/js/Core/Theme.js @@ -139,6 +139,16 @@ Ox.Theme = (function() { .html(values[+index]); }; + /*@ + formatColorPercent 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 Returns a themed colored image @*/