Java RGB Color Create toRGB(final int r, final int g, final int b, final int a)

Here you can find the source of toRGB(final int r, final int g, final int b, final int a)

Description

to RGB

License

Apache License

Declaration

public static int toRGB(final int r, final int g, final int b, final int a) 

Method Source Code

//package com.java2s;
/*/*from w  w w. jav a2s .c o m*/
 * Copyright 2017 Red Hat, Inc. and/or its affiliates.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

public class Main {
    public static int toRGB(final int r, final int g, final int b, final int a) {
        return ((a & 0xFF) << 24) | ((r & 0xFF) << 16) | ((g & 0xFF) << 8) | ((b & 0xFF) << 0);
    }
}

Related

  1. rgbComponents(int argb)
  2. rgbDistance(int color1, int color2)
  3. rgbFromColorInt(int c)
  4. rgbFromGrayscale(int grayscale)
  5. toRGB(byte r, byte g, byte b, byte a)
  6. toRGB(float h, float s, float l)
  7. toRGB(int alpha, int red, int green, int blue)
  8. toRGB(int color)
  9. toRgb(int r, int g, int b)