【解决方案】将RGB颜色转换为十六进制格式

将RGB颜色转换为十六进制格式

public class FindColor {
    public static String changeColorToCode(int red,int green,int blue){
        return Integer.toHexString(red << 16 | green << 8 | blue);
    }
    public static void main(String[] args) {
        System.out.println(changeColorToCode(68,140,203));
    }
}
console:448ccb
posted @ 2021-07-27 22:33  拉布  阅读(188)  评论(0编辑  收藏  举报