October 6, 2023, 23:27
|
transplant colormaps from paraview to MATLAB
|
#1
|
Senior Member
Join Date: Oct 2017
Location: United States
Posts: 233
Rep Power: 10
|
Hi,
I'm trying to implement some of the colormaps in paraview to matlab. I found a website that provides the data (link: https://kitware.github.io/paraview-d...colorMaps.html).
For example, I'm trying to implement this BuRd colormap
Code:
<ColorMap name="BuRd" space="Lab">
<Point x="-1" o="1" r="0.019608" g="0.188235" b="0.380392"/>
<Point x="-0.87451" o="1" r="0.088504" g="0.321107" b="0.564937"/>
<Point x="-0.74902" o="1" r="0.163399" g="0.444983" b="0.697501"/>
<Point x="-0.623529" o="1" r="0.247059" g="0.555709" b="0.754095"/>
<Point x="-0.498039" o="1" r="0.420684" g="0.676432" b="0.818685"/>
<Point x="-0.372549" o="1" r="0.606459" g="0.789773" b="0.880277"/>
<Point x="-0.247059" o="1" r="0.761476" g="0.868512" b="0.924567"/>
<Point x="-0.121569" o="1" r="0.878047" g="0.925721" b="0.951942"/>
<Point x="0.00392157" o="1" r="0.969089" g="0.966474" b="0.964937"/>
<Point x="0.129412" o="1" r="0.983852" g="0.897578" b="0.846828"/>
<Point x="0.254902" o="1" r="0.982468" g="0.800692" b="0.706113"/>
<Point x="0.380392" o="1" r="0.960323" g="0.66782" b="0.536332"/>
<Point x="0.505882" o="1" r="0.894579" g="0.503806" b="0.399769"/>
<Point x="0.631373" o="1" r="0.81707" g="0.33218" b="0.281046"/>
<Point x="0.756863" o="1" r="0.728489" g="0.155017" b="0.197386"/>
<Point x="0.882353" o="1" r="0.576932" g="0.055363" b="0.14925"/>
<Point x="1" o="1" r="0.403922" g="0" b="0.121569"/>
</ColorMap>
The head indicates that the values r/g/b here is in the LAB space, not the usual RGB space. However, when I used MATLAB built-in function lab2rgb to convert these values to RGB, the results are clearly wrong (some are negative, some are beyond 1). If I just use these numbers as they are, the resulting colors are wrong.
Does any one have experience in this?
|
|
|