Skip to content

Commit

Permalink
Deprecate more complicated way of defining colors. (#14305)
Browse files Browse the repository at this point in the history
Keep simple with a dict.
  • Loading branch information
Carreau committed Jan 31, 2024
2 parents 4eab608 + dad1cd5 commit 5f4d6ac
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion IPython/utils/coloransi.py
Expand Up @@ -10,6 +10,7 @@


import os
import warnings

from IPython.utils.ipstruct import Struct

Expand Down Expand Up @@ -116,8 +117,18 @@ class ColorScheme:
name: str
colors: Struct

def __init__(self,__scheme_name_,colordict=None,**colormap):
def __init__(self, __scheme_name_, colordict=None, **colormap):
self.name = __scheme_name_
if colormap:
warnings.warn(
"Passing each colors as a kwarg to ColorScheme is "
"considered for deprecation. Please pass a "
"a single dict as second parameter. If you are using this"
"feature, please comment an subscribe to issue "
"https://github.com/ipython/ipython/issues/14304",
PendingDeprecationWarning,
stacklevel=2,
)
if colordict is None:
self.colors = Struct(**colormap)
else:
Expand Down

0 comments on commit 5f4d6ac

Please sign in to comment.