Flip colors.

@param n the n
550811
private void flipColors(MtasRBTreeNode n) {
    // n must have opposite color of its two children
    assert (n != null) && (n.leftChild != null) && (n.rightChild != null);
    assert (!isRed(n) && isRed(n.leftChild) && isRed(n.rightChild))
        || (isRed(n) && !isRed(n.leftChild) && !isRed(n.rightChild));
    n.color ^= 1;
    n.leftChild.color ^= 1;
    n.rightChild.color ^= 1;
  }
623932
protected void setForeground(Color newColor)
    {
        if (foreground == null || !foreground.equals(newColor))
        {
            foreground = new Color(newColor.getRGB());
            invalidateCache();
        }
    }
230136
public void setColor(int color) {
        if (mState.mBaseColor != color || mState.mUseColor != color) {
            invalidateSelf();
            mState.mBaseColor = mState.mUseColor = color;
        }
    }
1099602
private int[] buildVertexColor() {
        int[] color = new int[g.length];

        int n = 1;
        Arrays.fill(color, -1);
        for (long cycle : cycles) {
            for (int i = 0; i < g.length; i++) {
                if ((cycle & 0x1) == 0x1) color[i] = color[i] < 0 ? n : 0;
                cycle >>= 1;
            }
            n++;
        }

        return color;
    }
532522
public static void flipHorizontal( GrayS32 input ) {
		int w2 = input.width/2;

		for( int y = 0; y < input.height; y++ ) {
			int index1 = input.getStartIndex() + y * input.getStride();
			int index2 = index1 + input.width-1;

			int end = index1 + w2;

			while( index1 < end ) {
				int tmp = input.data[index1];
				input.data[index1++] = input.data[index2];
				input.data[index2--] = (int)tmp;
			}
		}
	}
1169202
public void setSecondColor(final Color COLOR) {
        if (null == secondColor) {
            _secondColor = COLOR;
            fireUpdateEvent(REDRAW_EVENT);
        } else {
            secondColor.set(COLOR);
        }
    }
330961
private void ones(int n) {
        if (n > value.length)
            value = new int[n];
        Arrays.fill(value, -1);
        offset = 0;
        intLen = n;
    }
994959
public static void setPreferredColor(int color) {
		final Preferences prefs = Preferences.userNodeForPackage(MapElementConstants.class);
		if (prefs != null) {
			prefs.putInt("COLOR", color); //$NON-NLS-1$
			try {
				prefs.flush();
			} catch (BackingStoreException exception) {
				//
			}
		}
	}
408791
public void setColor(int color) {
		int x1, y1;
		if(mOrientation) {
			x1 = (mBarLength + mBarPointerHaloRadius);
			y1 = mBarThickness;
		}        else {
			x1 = mBarThickness;
			y1 = (mBarLength + mBarPointerHaloRadius);
		}
		
		Color.colorToHSV(color, mHSVColor);
		shader = new LinearGradient(mBarPointerHaloRadius, 0,
				x1, y1, new int[] {Color.WHITE, color, Color.BLACK}, null,
				Shader.TileMode.CLAMP);
		mBarPaint.setShader(shader);
	    calculateColor(mBarPointerPosition);
		mBarPointerPaint.setColor(mColor);
		if (mPicker != null) {
			mPicker.setNewCenterColor(mColor);
			if(mPicker.hasOpacityBar())
				mPicker.changeOpacityBarColor(mColor);
		}
		invalidate();
	}
118448
public void flipY(double y0, double y1) {
		yx = -yx;
		yy = -yy;
		yd = y0 + y1 - yd;
	}
1010998
public void setColor(float red, float green, float blue) {
		setRed(red);
		setGreen(green);
		setBlue(blue);
	}
741885
private MtasRBTreeNode rotateRight(MtasRBTreeNode n) {
    assert (n != null) && isRed(n.leftChild);
    MtasRBTreeNode x = n.leftChild;
    n.leftChild = x.rightChild;
    x.rightChild = n;
    x.color = x.rightChild.color;
    x.rightChild.color = MtasRBTreeNode.RED;
    x.n = n.n;
    n.n = size(n.leftChild) + size(n.rightChild) + 1;
    setMax(n);
    setMax(x);
    return x;
  }
542144
def next(n=1)
      @@colorset[mode] ||= Colorable::Colorset.new(order: mode)
      idx = @@colorset[mode].find_index(self)
      @@colorset[mode].at(idx+n).tap{|c| c.mode = mode } if idx
    end
1187497
def update_colors(self, colors):
        """"""
        
        colors = np.array(colors, dtype=np.uint8)
        self._vbo_c.set_data(colors)
        self._vbo_c.unbind()
930350
public void setBackgroundColor(int color) {
        setBackgroundColorR(Colors.byteToGl(Color.red(color)));
        setBackgroundColorG(Colors.byteToGl(Color.green(color)));
        setBackgroundColorB(Colors.byteToGl(Color.blue(color)));
        setBackgroundColorA(Colors.byteToGl(Color.alpha(color)));
    }
617240
public static void flip(WsByteBuffer[] list) {
        if (list != null) {
            for (int i = 0; i < list.length; i++) {
                if (list[i] != null) {
                    list[i].flip();
                }
            }
        }
    }
866148
public void flip(TextureFlipMode mode){
		float[][] tmp = corner.clone();
		switch (mode) {
		case VERTICAL:
			corner[0] = tmp[1];
			corner[1] = tmp[0];
			corner[2] = tmp[3];
			corner[3] = tmp[2];
			break;
		case HORIZONTAL:
			corner[0] = tmp[3];
			corner[1] = tmp[2];
			corner[2] = tmp[1];
			corner[3] = tmp[0];
			break;
		default:
			break;
		}
	}