public final class Colors extends Object
限定符和类型 | 方法和说明 |
---|---|
static Color |
as(String str)
将字符串变成颜色值
|
static Color |
fromString(String str)
已过时。
|
static int |
getAlpha(int pixel) |
static int |
getGray(BufferedImage srcIm,
int x,
int y)
获取图片指定像素点的灰度值
|
static int |
getLuminance(BufferedImage srcIm,
int x,
int y)
获取图片指定像素点的亮度值(YUV中的Y)
|
static double |
getLuminanceDouble(BufferedImage srcIm,
int x,
int y)
获取图片指定像素点的亮度值(YUV中的Y) 类型为double
|
static int |
getMultiply(int pixel1,
int pixel2)
获取两个像素点正片叠底后的像素值
|
static int[] |
getRGB(BufferedImage srcIm,
int x,
int y)
获取图片指定像素点的RGB值
|
static int[] |
getRGB(int pixel)
获取像素点的RGB值(三元素数组))
|
static Color |
randomColor()
获取一个随机颜色
|
static Color |
randomColor(int min,
int max)
获取一个制定范围内的颜色
|
static String |
toRGB(Color color)
Color转换为 “rgb(12, 25, 33)” 格式字符串
|
@Deprecated public static Color fromString(String str)
as(String)
public static String toRGB(Color color)
color
- 颜色public static Color randomColor(int min, int max)
min
- 最小取值,范围0-255max
- 最大取值,范围0-255public static Color randomColor()
public static int[] getRGB(BufferedImage srcIm, int x, int y)
srcIm
- 源图片x
- 横坐标y
- 纵坐标public static int[] getRGB(int pixel)
pixel
- 像素RGB值public static int getAlpha(int pixel)
public static int getLuminance(BufferedImage srcIm, int x, int y)
srcIm
- 源图片x
- 横坐标y
- 纵坐标public static double getLuminanceDouble(BufferedImage srcIm, int x, int y)
srcIm
- 源图片x
- 横坐标y
- 纵坐标public static int getGray(BufferedImage srcIm, int x, int y)
srcIm
- 源图片x
- 横坐标y
- 纵坐标public static int getMultiply(int pixel1, int pixel2)
pixel1
- 像素点1pixel2
- 像素点1Copyright © 2017. All rights reserved.