-
-
Notifications
You must be signed in to change notification settings - Fork 24
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
added colorAdd() #53
base: main
Are you sure you want to change the base?
added colorAdd() #53
Conversation
colorAdd() allows the user to add a new color with RGB
for more information, see https://pre-commit.ci
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #53 +/- ##
===========================================
- Coverage 100.00% 98.31% -1.69%
===========================================
Files 3 3
Lines 116 119 +3
===========================================
+ Hits 116 117 +1
- Misses 0 2 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
Thanks for the PR! These are some automated checks to make sure tests pass and some code quality/linters are happy. I added a changelog label, so that's now happy. There's still some lint things to check, but I'll add a review with some other suggestions first. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please can you add some unit tests so we know this is working correctly?
COLORS, | ||
HIGHLIGHTS, | ||
RESET, | ||
colorAdd, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's follow PEP 8 and use snake case (here and elsewhere):
colorAdd, | |
add_color, |
"underline": "4", | ||
"blink": "5", | ||
"reverse": "7", | ||
"concealed": "8", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are all these now strings? Can we keep them as integers for backwards compatibility?
def colorAdd(color: str, RGB: tuple | None = None) -> None: | ||
"""add colors to Available text colors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def colorAdd(color: str, RGB: tuple | None = None) -> None: | |
"""add colors to Available text colors | |
def add_color(color: str, rgb: tuple | None = None) -> None: | |
"""add color to available text colors. |
color (str): collor index name, used to call this collor | ||
RGB (R, G, B): the RGB value of the collor you want to add. Defaults to None. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
color (str): collor index name, used to call this collor | |
RGB (R, G, B): the RGB value of the collor you want to add. Defaults to None. | |
color (str): color name | |
rgb (R, G, B): the RGB value of the color you want to add. Defaults to None. |
color (str): collor index name, used to call this collor | ||
RGB (R, G, B): the RGB value of the collor you want to add. Defaults to None. | ||
""" | ||
if not RGB == None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if not RGB == None: | |
if not rgb: |
@@ -140,7 +151,7 @@ def colored( | |||
Available text colors: | |||
black, red, green, yellow, blue, magenta, cyan, white, | |||
light_grey, dark_grey, light_red, light_green, light_yellow, light_blue, | |||
light_magenta, light_cyan. | |||
light_magenta, light_cyan, and all collors added by addCollor(). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
light_magenta, light_cyan, and all collors added by addCollor(). | |
light_magenta, light_cyan, and any colors added via add_color(). |
Reminder that this needs some updates. Let me know if you've any questions. Thanks! |
colorAdd() allows the user to add a new color with RGB
example;
colorAdd("Light Coral", (240, 128, 128))
now you can use "Light Coral" as a color