Mercurial > hg > digilib-old
changeset 1069:788c757d7f70
made contrast slider perview look like contrast action.
author | robcast |
---|---|
date | Fri, 13 Apr 2012 18:41:47 +0200 |
parents | c1df386f2464 |
children | 27ee06879f14 |
files | webapp/src/main/webapp/jquery/jquery.digilib.sliders.js |
diffstat | 1 files changed, 2 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/webapp/src/main/webapp/jquery/jquery.digilib.sliders.js Fri Apr 13 18:16:59 2012 +0200 +++ b/webapp/src/main/webapp/jquery/jquery.digilib.sliders.js Fri Apr 13 18:41:47 2012 +0200 @@ -126,7 +126,8 @@ var $td = $ind.find('table.'+cls+'indicator td'); var setBgColor = function (index) { var val = index * 32; - var grey = Math.min(Math.max(Math.round(Math.pow(2, cont) * val), 0), 255); + var m = Math.pow(2, cont); + var grey = Math.min(Math.max(Math.round(m * val + (127 - 127 * m)), 0), 255); $(this).css('background-color', 'rgb('+grey+','+grey+','+grey+')'); }; $td.each(setBgColor);