Skip to content

Conversation

@tdegeus
Copy link
Owner

@tdegeus tdegeus commented Feb 10, 2021

Here is a first proposal @davidbrochart . Please feel free to comment.

This allows for the following

    auto c = cppcolormap::Greys(5);
    xt::xtensor<double, 1> data = {0, 1, 2, 3, 4};
    std::cout << cppcolormap::as_colors(data, c) << std::endl;

Fixes #24

P.S. I should probably introduce tests. In contrast to the colormaps this is something that could actually go wrong.

@davidbrochart
Copy link

I just tried it on a real use-case, and it works great 👍
Thanks a lot!

@tdegeus
Copy link
Owner Author

tdegeus commented Feb 12, 2021

@davidbrochart I simplified the implementation a bit (same API). I was just doubting for a second if the name could be improved. However, I don't have good ideas. Do you still have suggestions?

@davidbrochart
Copy link

The only thing I can think of is map_colors, but as_colors is fine too.

@tdegeus tdegeus merged commit 8b0de2a into master Feb 12, 2021
@tdegeus tdegeus deleted the map branch February 12, 2021 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

High-level API

3 participants