2 deleted 2 characters in body
source | link

Python 2, 123123 85 bytes

from PIL import Image
c=Image.open(input()).getcolorsgetdata()
print c and len(set(c)<2and'#'+''.join(hex(p)[2:] for p in<2and c[0][1][c[0][:3])

Try it online!

Python 2, 123 bytes

from PIL import Image
c=Image.open(input()).getcolors()
print c and len(c)<2and'#'+''.join(hex(p)[2:] for p in c[0][1][:3])

Try it online!

Python 2, 123 85 bytes

from PIL import Image
c=Image.open(input()).getdata()
print len(set(c))<2and c[0][:3]
1
source | link

Python 2, 123 bytes

from PIL import Image
c=Image.open(input()).getcolors()
print c and len(c)<2and'#'+''.join(hex(p)[2:] for p in c[0][1][:3])

Try it online!