📄 mycolour.java
字号:
/**
* An color class to indicating if a colour is white
* and returning the hexadecimal value of a colour.
* @author Ruixiao Wu
* @version 1.0 02/06/2006
*/
import java.awt.Color;
public class MyColour extends Color {
/**
* A class extends Color
*
* @author Ruixiao Wu
* @version 1.0 02/06/2006
*/
private static final long serialVersionUID = 4502401381904651057L;
public MyColour(int R, int G, int B) {
super(R, G, B);
}
/**
* A method to check the color and ndicating if a colour is white.
*
* @param R,G,B,checkcolor
*/
public static boolean checkColor(int R, int G, int B) {
boolean checkcolor;
if (R == 255 && G == 255 && B == 255)
checkcolor = true;
else
checkcolor = false;
return checkcolor;
}
/**
* A method to convert the green value to hexadecimal.
*
* @param greenHex,integer
*/
public static String convertGreenTohex(Integer integer) {
//if(integer!=0)
String greenHex = Integer.toHexString(integer).toUpperCase();
if (integer == 0)
greenHex = "00";
return greenHex;
}
/**
* A method to convert the blue value to hexadecimal.
*
* @param blueHex,integer
*/
public static String convertBlueTohex(Integer integer) {
String blueHex = Integer.toHexString(integer).toUpperCase();
blueHex.toUpperCase();
if (integer == 0)
blueHex = "00";
return blueHex;
}// End method.
}// End MyColour class.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -