public static float HDelta(JPColor one, JPColor another) { float ratio = one.A * another.A; float delta = (one.H - another.H) * ratio; return(delta > 0 ? delta : -delta); }
/* inter */ /* func */ /// <summary> /// 求两个颜色的差值 /// </summary> /// <returns>RGBA 视觉下的颜色差值</returns> public static JPVector3 RGBADelta(JPColor one, JPColor another) { float ratio = another.A; JPVector3 result; if (ratio > 0) { result = new JPVector3( (one.R - another.R) * ratio, (one.G - another.G) * ratio, (one.B - another.B) * ratio); } else { result = JPVector3.Zero; } return(result); }