Lines Matching refs:black

680 and 2 (black and white) for grays. This covers StaticGray, StaticColor,
851 a color cube. Check pairs of black and white cells trying to find
859 XColor *ramp, *black, *white, *altBlack, *altWhite;
874 /* Find the white and black entries */
876 black = white = altBlack = altWhite = NULL;
881 if (black == NULL) black = ramp+i;
890 if (black == NULL || white == NULL) {
896 /* Look for cubes between pairs of black & white */
897 if (!CheckCube(black, white, colorCube) &&
899 !CheckCube(black, altWhite, colorCube) &&
920 XColor *black,
935 if (black == NULL || white == NULL) return False;
937 k = black->pixel;
947 color = black + i*mult;
950 /* If black or white is in the middle of the cube, can't work */
1051 (black[i*mult].red >> 8);
1053 (black[i*mult].green >> 8);
1055 (black[i*mult].blue >> 8);
1077 a gray ramp. This handles there being 2 white or black entries
1079 white and black. If there is a color cube, also check its diagonal and
1088 XColor *ramp, *black, *white, *altBlack, *altWhite;
1104 /* Find the white and black entries */
1106 black = white = altBlack = altWhite = NULL;
1110 if (black == NULL) black = ramp+i;
1118 if (black == NULL || white == NULL) {
1124 /* Find out how large a ramp exists between pairs of black & white */
1125 r0 = FindRampSize(black, white);
1127 r2 = FindRampSize(black, altWhite);
1134 if (size == r0) SetRamp(black, white, size, &redMult, &base);
1136 else if (size == r2) SetRamp(black, altWhite, size, &redMult, &base);
1151 static int FindRampSize(XColor *black, XColor *white)
1158 if (black == NULL || white == NULL) return 0;
1159 size = ABS(white - black);
1162 if (black > white) mult = -1;
1164 /* See if all cells between black and white are linear, to within 1 bit.
1168 c = &black[i*mult];
1177 XColor *black,
1183 *base = black->pixel;
1184 *mult = (white - black) / size;