Lines Matching refs:white
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;
885 if (white == NULL) white = ramp+i;
890 if (black == NULL || white == NULL) {
896 /* Look for cubes between pairs of black & white */
897 if (!CheckCube(black, white, colorCube) &&
898 !CheckCube(altBlack, white, colorCube) &&
921 XColor *white,
935 if (black == NULL || white == NULL) return False;
938 w = white->pixel - k;
950 /* If black or white is in the middle of the cube, can't work */
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;
1113 if (white == NULL) white = 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);
1126 r1 = FindRampSize(altBlack, white);
1134 if (size == r0) SetRamp(black, white, size, &redMult, &base);
1135 else if (size == r1) SetRamp(altBlack, white, 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.
1178 XColor *white,
1184 *mult = (white - black) / size;