Created
June 12, 2020 20:08
-
-
Save GeneralistDev/93c962047092dad7c28e03f3eb2a0eed to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if __name__ == "__main__": | |
| if (len(sys.argv) != 2): # Checks if image was given as cli argument | |
| print("error: syntax is 'python main.py /example/image/location.jpg'") | |
| else: | |
| BackgroundColor = BackgroundColorDetector(sys.argv[1]) | |
| average_color = BackgroundColor.detect() | |
| print(average_color) | |
| # renderer = ColorRenderer(average_color) | |
| # renderer.render() | |
| WhiteList = [ | |
| (255,255,255), | |
| # Add more white shades here | |
| ] | |
| for shade in WhiteList: | |
| if average_color == shade: | |
| print("This image has a white average color") | |
| sys.exit(0) | |
| # If we get here it means we didn't find white | |
| print("This image does not have an average white color") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment