Java Color Alpha setColorAlpha(Color c, int alpha)

Here you can find the source of setColorAlpha(Color c, int alpha)

Description

set Color Alpha

License

Apache License

Declaration

public static Color setColorAlpha(Color c, int alpha) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.awt.Color;

public class Main {
    public static Color setColorAlpha(Color c, int alpha) {
        if (alpha > 255 || alpha < 0)
            return c;
        return new Color(c.getRed(), c.getGreen(), c.getBlue(), alpha);
    }/*from  w  w w .j  ava 2s  .c om*/
}

Related

  1. deriveWithAlpha(Color color, int alpha)
  2. newColourWithAlpha(Color color, double alpha)
  3. noAlpha(final Color col)
  4. overwriteAlpha(Color c, float alpha)
  5. premultiplyAlpha(Color fgColor, Color bgColor)
  6. setColorAlpha(Color color, int alpha)
  7. transparent(final Color color, final int alpha)
  8. transparentColor(Color color, int alpha)
  9. washColor(int red, int green, int blue, int alpha, int amountToWash)