vmagnin / forcolormap

A Fortran library for colormaps
https://vmagnin.github.io/forcolormap/
MIT License
21 stars 4 forks source link

Add 'extract' type-bound procedure to 'Colormap'. #13

Closed gha3mi closed 11 months ago

gha3mi commented 11 months ago

Hello @vmagnin,

This PR introduces the extract feature discussed in #8.

With this functionality, it's now possible to extract colors from a colormap. The extracted number should be within the range [2, levels].

I compared some binary colormaps generated by the extract function with scientific colormaps, and they match.

Changes Made:

Best, Ali

gha3mi commented 11 months ago

Maybe it is better now to update the COLORMAPS_LIST.md by removing the discrete colormaps.

vmagnin commented 11 months ago

Maybe it is better now to update the COLORMAPS_LIST.md by removing the discrete colormaps.

Yes, it would lighten the list, even if we let the colormaps in the Fortran module.

vmagnin commented 11 months ago

I think that in the example extract I will put 10 levels instead of 100, because with 100 we don't really see the difference from the original map (with 256 levels).

gha3mi commented 11 months ago

Yes, 100 were used in my last comparison. I forgot to decrease it.