我使用色调
创建我的Google地图标记标记的色调。值必须大于或等于0且小于360。
有没有办法将这个色调转换为漂浮为rgb颜色?
由于
答案 0 :(得分:5)
试试这段代码:
float hue = 180.0f;
int color = Color.HSVToColor(new float[] { hue, 1.0f, 1.0f });
更多信息:
/**
* Convert HSV components to an ARGB color. Alpha set to 0xFF.
* hsv[0] is Hue [0 .. 360)
* hsv[1] is Saturation [0...1]
* hsv[2] is Value [0...1]
* If hsv values are out of range, they are pinned.
* @param hsv 3 element array which holds the input HSV components.
* @return the resulting argb color
*/
public static int HSVToColor(float hsv[]) {