From 25b39de5b700e5e14727b431645196628547b950 Mon Sep 17 00:00:00 2001 From: paddywwoof Date: Thu, 19 Sep 2013 15:30:08 +0100 Subject: [PATCH] ImageColor defaults to alpha = 255 in only rgb specified for RGBA mode --- PIL/ImageColor.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PIL/ImageColor.py b/PIL/ImageColor.py index 2a190fc66..86f221adc 100644 --- a/PIL/ImageColor.py +++ b/PIL/ImageColor.py @@ -102,6 +102,8 @@ def getcolor(color, mode): if mode == "RGB": return color if mode == "RGBA": + if len(color) == 3: + color = (color + (255,)) r, g, b, a = color return r, g, b, a if Image.getmodebase(mode) == "L":