source: issm/oecreview/Archive/19101-20495/ISSM-19807-19808.diff@ 20498

Last change on this file since 20498 was 20498, checked in by Mathieu Morlighem, 9 years ago

CHG: done with Archive/19101-20495

File size: 690 bytes
  • ../trunk-jpl/src/m/plot/webgl.js

     
    116116        return modelMatrix;
    117117} //}}}
    118118function rgb(value, min, max) { //{{{
     119       
     120        var normalizedValue;
    119121                                       
    120122        colorbar=colorbars["rainbow"];
    121123
    122124        value = clamp(value, min, max);
    123         var normalizedValue = (value - min) / (max - min);
     125        if((max-min)!=0) normalizedValue = (value - min) / (max - min);
     126        else normalizedValue = value;
     127
    124128        var index = clamp(Math.round(normalizedValue * colorbar.length), 0, colorbar.length - 1);
    125129        return colorbar[index];
    126130} //}}}
Note: See TracBrowser for help on using the repository browser.