Lines Matching defs:dark
34 * <p>Instances of this class represent an immutable square grid of dark and light cells.
264 * for light or {@code true} for dark. The top left corner has the coordinates (x=0, y=0).
269 * at that location is dark, or {@code false} (light) otherwise
308 setModule(8, size - 8, 1); // Always dark
314 private void setModule(int x, int y, int dark) {
317 assert dark == 0 || dark == 1;
320 modules[i >>> 5] |= dark << i;
416 int dark = 0;
441 dark += c;
477 // Balance of dark and light modules
478 int total = size * size; // Note that size is odd, so dark/total != 1/2
479 // Compute the smallest integer k >= 0 such that (45-5k)% <= dark/total <= (55+5k)%
480 int k = (Math.abs(dark * 20 - total * 10) + total - 1) / total - 1;
512 if (currentRunColor == 1) { // Terminate dark run