diff --git a/source/Ox.UI/js/Core/Theme.js b/source/Ox.UI/js/Core/Theme.js index 8436419a..14b7226f 100644 --- a/source/Ox.UI/js/Core/Theme.js +++ b/source/Ox.UI/js/Core/Theme.js @@ -19,7 +19,8 @@ Ox.Theme = (function() { theme = ''; classNames && Ox.forEach(classNames.split(' '), function(className) { if (Ox.startsWith(className, 'OxTheme')) { - theme = className.replace('OxTheme', '').toLowerCase(); + theme = className.replace('OxTheme', ''); + theme = theme[0].toLowerCase() + theme.substr(1); return false; // break } }); @@ -27,15 +28,15 @@ Ox.Theme = (function() { } function renderElement(value, type) { - var $element, background, color, lightness = that[getTheme()].lightness; + var $element, background, color, data = that.getThemeData(); if (type == 'hue') { - background = Ox.rgb(value, 1, lightness.background); - color = Ox.rgb(value, 1, lightness.color); + background = Ox.rgb(value, 1, data.themeLightnessBackground); + color = Ox.rgb(value, 1, data.themeLightnessColor); } else if (type == 'saturation') { background = Ox.range(7).map(function(i) { - return Ox.rgb(i * 60, value, lightness.background); + return Ox.rgb(i * 60, value, data.themeLightnessBackground); }); - color = Ox.rgb(0, 0, lightness.color); + color = Ox.rgb(0, 0, data.themeLightnessColor); } else if (type == 'lightness') { background = Ox.range(3).map(function() { return Math.round(value * 255); @@ -45,11 +46,11 @@ Ox.Theme = (function() { }); } else if (type == 'gradient') { background = Ox.range(2).map(function(i) { - return Ox.rgb(value, 1, lightness.background).map(function(value) { + return Ox.rgb(value, 1, data.themeLightnessBackground).map(function(value) { return value + (i == 0 ? 16 : -16); }); }); - color = Ox.rgb(value, 1, lightness.color); + color = Ox.rgb(value, 1, data.themeLightnessColor); } $element = $('