Add command line color option #1
No reviewers
No assignees
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No project
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
No due date set.
Reference
sahin/binary-clock-wallpaper!1
Loading…
Reference in a new issue
No description provided.
Delete branch "main"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This add a command line option to specify the accent color:
The color option can also be passed too the shell script:
Command line arguments are captured using
sys.argv, I figured using a library asargparsewas a little bit overkill to add just one option but I could replace this by a real argument parser (with better error capturing and--helpmessage) if you are interested.Thank you for this cool little script!
Thank you for taking time to contribute! I will review this later this evening. Also thanks for your nice words.
@@ -7,12 +9,12 @@ base_image_path = os.path.join(base_dir, "img", "base.png")result_image_path = os.path.join(base_dir, "img", "result.png")I think this should not print "Invalid command line arguments". One can run script without any argument and it should be fine. Maybe you can change it to something like "No color specified, using default color value"
Thank you for your contribution! I will merge this if you can address the issues I mentioned. If you don't agree and have a good reason about it, I am more than happy to hear about it.
@@ -7,12 +9,12 @@ base_image_path = os.path.join(base_dir, "img", "base.png")result_image_path = os.path.join(base_dir, "img", "result.png")I am not sure whether validating the color should be our concern or not. Yeah, it is a nice feature but I think even if the color is not valid, PIL should handle it by throwing an error.
Another good reason to remove this regex is being able to use generic color names such as "red", "green" etc. PIL knows how to process them but this regex does not allow them.
Following your comments, I remove the error if no arguments are passed (
args = []) and the color validation. If the color is specified with a hex code, the#must now be specified:Thank you!