我正在尝试将整数表示法转换为 RGB 表示法。
"Integer notation is a value from 0 to 16777215 and it can be obtained from a rgb code rgb(R,G,B) using the formula 256*256*R+256*G+B."
我明白了,但是从整数表示法转换为 RGB 的公式是什么?
因此,如果我输入 887766,我应该返回 (13,139,214) - 我该怎么做?
大家干杯
最佳答案
Color color = new Color(intValue);
System.out.println(color.getRed() + ", " + color.getGreen() + ", " + color.getBlue());
关于java - 将整数表示法转换为 RGB 表示法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19417310/