/// <summary>
/// 颜色hex转hsv
/// </summary>
/// <param name="colorValue">注意传入时在十六进制前需要带“#”,例如“#FFFFFF”</param>
/// <param name="hsvVec">0~1</param>
public static void ColorHexToHsv(string colorValue, out Vector3 hsvVec)
{
Color rgbColor;
//rgb 0~1
ColorUtility.TryParseHtmlString(colorValue, out rgbColor);
//rgb 0~1
//hsv 0~1
Color.RGBToHSV(rgbColor, out hsvVec.x, out hsvVec.y, out hsvVec.z);
}
unity 颜色hex转hsv
猜你喜欢
转载自blog.csdn.net/weixin_47819574/article/details/131292252
今日推荐
周排行