question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[FEATURE] Make palettes return Color

See original GitHub issue

I was a bit surprised to find that the colors returned by viridis() (and other palettes) are simple Hex strs, not instances of Color. I had expected that I can call darken and lighten on the generated values, but unfortunately that seems not to be the case.

Additionally, I cannot seem to find a way to generate a Color instance out of the hex strings, as there is no from_css, from_hex or similar method. The only way seems to be to split the str manually, convert the numbers from hex to decimal, and then create a RGB object from that.

What I would like to have is that the palettes return Color instances, so that I can use the full range of methods on them.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
fdwcommented, Mar 10, 2020

Unfortunately, I haven’t found the time, and have since then also migrated away from Bokeh. So if someone still wants to do this, feel free. If not, you can also close this ticket.

Thanks for your help and Bokeh!

0reactions
bryevdvcommented, Mar 10, 2020

Absent other input I will close for now

Read more comments on GitHub >

github_iconTop Results From Across the Web

Setting up Color Palettes in R
In this post we'll look at some ways you can define new color palettes for plotting in R. To begin, let's use the...
Read more >
How to Make a Custom Color Palette and Swatch ... - YouTube
Learn how to save a color swatch and custom color palette from a photo in Photoshop. Essential skills you will learn:- How to...
Read more >
Make Hundreds of Color Palettes from 1 COLOR! - YouTube
Adobe Photoshop CC 2020 tutorial. What is the best way to build color palettes in Adobe Photoshop 2020? How do you combine colors...
Read more >
Easy Way To Expand Color Palettes in R - Datanovia
This article describes how to use the colorRampPalette() R function to expand color palettes. We'll provide practical example with ggplot2.
Read more >
Selecting Colors with the Palette API - Android Developers
To access all colors in a palette, the getSwatches() method returns a list of all swatches generated from an image, including the standard...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found