Coder Social home page Coder Social logo

Comments (4)

DanielYang59 avatar DanielYang59 commented on June 15, 2024 1

This is now possible with the combine_cmaps utility. It doesn't directly allow chop out a part of a colormap but you could achieve this by taking two sub_cmaps to avoid the central unwanted part, and recombine them, like so:

from cmasher.utils import combine_cmaps, get_sub_cmap, view_cmap

cmap_part_0 = get_sub_cmap("cmr.fusion", 0, 0.45)
cmap_part_1 = get_sub_cmap("cmr.fusion", 0.55, 1)

new_cmap = combine_cmaps(cmap_part_0, cmap_part_1)
view_cmap(new_cmap)

In this case I removed the central 10% but apparently you would need some further tweaking.

Before:
before

After:
after

from cmasher.

neutrinoceros avatar neutrinoceros commented on June 15, 2024 1

Thanks @DanielYang59 for your reply ! Indeed it seems that we now have API to support this use case so I believe this can be closed as solved in cmasher 1.8.0. Feel free to ping me if I'm understanding this wrong and the issue should be re-opened !

from cmasher.

1313e avatar 1313e commented on June 15, 2024

Hmm, that shouldn't be too hard to make. I can have a look at that.

from cmasher.

psharda avatar psharda commented on June 15, 2024

Great, thanks! Looking forward to it.

from cmasher.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.