Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate more complicated way of defining colors. #14305

Merged
merged 2 commits into from Jan 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 @@ -114,8 +115,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