2118fb80386b56219609bb0e50a2565092a72dae jcasper Fri Mar 17 09:53:14 2023 -0700 bedParseRgb doesn't need to add alpha for 3-value color - that's added later when colors are translated to the graphics level. So we'll accept 255,255,255 as a color again. refs #30569 diff --git src/lib/basicBed.c src/lib/basicBed.c index 5d46a6f..3899ebb 100644 --- src/lib/basicBed.c +++ src/lib/basicBed.c @@ -1064,32 +1064,31 @@ * has alpha in the highest-order byte, then r, then g, then b in the * lowest-order byte. This is a "bed" concept of an unsigned color, * which may not match the way the graphics libraries handle color bytes. */ { char dupe[64]; int wordCount; char *row[4]; strncpy(dupe, itemRgb, sizeof(dupe)); wordCount = chopString(dupe, ",", row, ArraySize(row)); if ((wordCount == 3) && (isdigit(row[0][0]) && isdigit(row[1][0]) && isdigit(row[2][0]))) return ( ((atoi(row[0]) & 0xff) << 16) | ((atoi(row[1]) & 0xff) << 8) | - (atoi(row[2]) & 0xff) | - (0xff << 24)); + (atoi(row[2]) & 0xff) ); if ((wordCount == 4) && (isdigit(row[0][0]) && isdigit(row[1][0]) && isdigit(row[2][0]) && isdigit(row[3][0]))) return ( ((atoi(row[0]) & 0xff) << 16) | ((atoi(row[1]) & 0xff) << 8) | (atoi(row[2]) & 0xff) | ((atoi(row[3]) & 0xff) << 24) ); return (-1); } unsigned int bedParseColor(char *colorSpec) /* Parse an HTML color string, a string of 3 or 4 comma-sep unsigned color values 0-255, * or a 6-digit hex string preceded by #. * O/w return unsigned integer value. Return -1 on error */