parent
cf2bad116d
commit
363ab9464e
@ -0,0 +1,45 @@
|
|||||||
|
package com.example.jmacro.wjdr.base;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 色值坐标点
|
||||||
|
*
|
||||||
|
* @author wangbing
|
||||||
|
* @version 0.0.1
|
||||||
|
* @since 1.8
|
||||||
|
*/
|
||||||
|
public class ViewColor extends ViewPoint {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 颜色值
|
||||||
|
*/
|
||||||
|
private int color;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param x 坐标
|
||||||
|
* @param y 坐标
|
||||||
|
* @param hexColor argb值 例如#FFFFFF
|
||||||
|
*/
|
||||||
|
public ViewColor(int x, int y, String hexColor) {
|
||||||
|
super(x, y);
|
||||||
|
this.color = Integer.parseInt(StrUtil.removePrefix(hexColor, "#"), 16);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ViewColor(int x, int y, int color) {
|
||||||
|
super(x, y);
|
||||||
|
this.color = color;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getColor() {
|
||||||
|
return color;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setColor(int color) {
|
||||||
|
this.color = color;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getHexColor() {
|
||||||
|
return "#" + Integer.toHexString(color);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue