You are to golf a program that will take a filename as input and you must output what color the file is.
The file will have any one of these extensions but your program only needs to support one. Please say which one in your answer.
And now to the classic layout.
A filename with one of the above extensions.
You may also take an image object or already encoded image instead.
The only color in that file as a 6 digit hex code with an optional leading
#000000 is black.
You may also output a list/tuple/string containing the decimal or hex values of the RGB color, with a clear, non-numeric delimiter e.g.
You may not output the transparency.
If the file isn't all one color, you must output a falsy value that isn't
#000000 and terminate without printing anything to
STDERR. This is so that you can't simply open the file and get the RGB value of the first pixel.
- The hex code only needs to be outputted if the file is all one color.
- The file will be
- The pixels will all have 0% transparency.
- This is code-golf so shortest code wins!