Skip to content

Commit

Permalink
Merge pull request #15 from lmcinnes/get_cmap_fix
Browse files Browse the repository at this point in the history
Try to fix the get_cmap issues
  • Loading branch information
lmcinnes authored Jun 18, 2024
2 parents c729eb1 + 3c50769 commit 0f9b4da
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
5 changes: 4 additions & 1 deletion glasbey/_converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
from numpy import clip, max, linspace, array, asarray, float32, integer
from colorspacious import cspace_convert
from matplotlib.colors import rgb2hex, to_rgb
from matplotlib.cm import get_cmap
try:
from matplotlib.cm import get_cmap
except ImportError:
from matplotlib.pyplot import get_cmap


def get_rgb_palette(cam02ucs_palette, as_hex: bool=True):
Expand Down
5 changes: 4 additions & 1 deletion glasbey/tests/test_converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
import numpy as np

from glasbey._converters import get_rgb_palette, palette_to_sRGB1
from matplotlib.cm import get_cmap
try:
from matplotlib.cm import get_cmap
except ImportError:
from matplotlib.pyplot import get_cmap
from matplotlib.colors import to_rgb
from colorspacious import cspace_convert

Expand Down
5 changes: 4 additions & 1 deletion glasbey/tests/test_glasbey.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@

from colorspacious import cspace_convert
from matplotlib.colors import to_rgb
from matplotlib.cm import get_cmap
try:
from matplotlib.cm import get_cmap
except ImportError:
from matplotlib.pyplot import get_cmap
from glasbey._glasbey import (
create_palette,
create_theme_palette,
Expand Down

0 comments on commit 0f9b4da

Please sign in to comment.