Java Color Alpha newColourWithAlpha(Color color, double alpha)

Here you can find the source of newColourWithAlpha(Color color, double alpha)

Description

new Colour With Alpha

License

Apache License

Declaration

public static Color newColourWithAlpha(Color color, double alpha) 

Method Source Code


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

import java.awt.Color;

public class Main {
    public static Color newColourWithAlpha(Color color, double alpha) {
        Color result = new Color(color.getRed(), color.getGreen(), color.getBlue(), (int) (255 * alpha));
        return result;
    }//ww  w .ja  v a2 s  .com
}

Related

  1. changeAlpha(Color c, double alpha)
  2. changeAlpha(Color c, double newAlpha)
  3. changeAlpha(Color c, int alpha)
  4. changeColorAlpha(@Nonnull Color color, int newAlpha)
  5. deriveWithAlpha(Color color, int alpha)
  6. noAlpha(final Color col)
  7. overwriteAlpha(Color c, float alpha)
  8. premultiplyAlpha(Color fgColor, Color bgColor)
  9. setColorAlpha(Color c, int alpha)