https://blog.csdn.net/A2009374138/article/details/52174856
hsv和rgb
相似度计算
https://blog.csdn.net/hai29785/article/details/55548798
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
//public class Hsv
//{
// public float H;
// public float S;
// public float V;
// public Hsv()
// {
// }
// //self-defined
// public Hsv(float h, float s, float v)
// {
// H = h;
// S = s;
// V = v;
// }
// public static double distanceOf(Hsv hsv1, Hsv hsv2)
// {
// float R = 100.0f;
// float angle = 30.0f;
// double h = R * Mathf.Cos(angle / 180 * Mathf.PI);
// double r = R * Mathf.Sin(angle / 180 * Mathf.PI);
// double x1 = r * hsv1.V * hsv1.S * Mathf.Cos(hsv1.H / 180 * Mathf.PI);
// double y1 = r * hsv1.V * hsv1.S * Mathf.Sin(hsv1.H / 180 * Mathf.PI);
// double z1 = h * (1 - hsv1.V);
// double x2 = r * hsv2.V * hsv2.S * Mathf.Cos(hsv2.H / 180 * Mathf.PI);
// double y2 = r * hsv2.V * hsv2.S * Mathf.Sin(hsv2.H / 180 * Mathf.PI);
// double z2 = h * (1 - hsv2.V);
// double dx = x1 - x2;
// double dy = y1 - y2;
// double dz = z1 - z2;
// return Mathf.Sqrt((float)(dx * dx + dy * dy + dz * dz));
//