parse tuple into "r" and "g" instead of "r" and "a" because we want to put the values in the first two bytes

This commit is contained in:
Yay295 2022-08-21 15:27:27 -05:00
parent e5039f8c15
commit a63bcfbfb4

View File

@ -550,10 +550,9 @@ getink(PyObject *color, Imaging im, char *ink) {
if (tupleSize != 1 && tupleSize != 2) { if (tupleSize != 1 && tupleSize != 2) {
PyErr_SetString(PyExc_TypeError, "color must be int, or tuple of one or two elements"); PyErr_SetString(PyExc_TypeError, "color must be int, or tuple of one or two elements");
return NULL; return NULL;
} else if (!PyArg_ParseTuple(color, "L|i", &r, &a)) { } else if (!PyArg_ParseTuple(color, "L|i", &r, &g)) {
return NULL; return NULL;
} }
g = b = r;
} else { } else {
if (tupleSize != 3 && tupleSize != 4) { if (tupleSize != 3 && tupleSize != 4) {
PyErr_SetString(PyExc_TypeError, "color must be int, or tuple of one, three or four elements"); PyErr_SetString(PyExc_TypeError, "color must be int, or tuple of one, three or four elements");