Atitit HSV -to- GRB should prioritize the use of the HSV color principle to facilitate human
1.1. 1.1.HSV color card 1
1.2. conversion from HSV to RGB 1
1.3. HSVtoRGBColorV22
1.1.
1.1.HSV color card
1.2.
conversion from HSV to RGB
Similarly, given in the HSV ( h, s, v) value defines a color with theh , and those that represent saturation and lightness, respectively. s and the v varies from 0 to 1 , corresponding in the RGB space ( R, g, b Three primary colors can be calculated as:
for each color vector (R, g, b),
1.3.
HSVtoRGBColorV2
public static Color HSVtoRGBColorV2 (HSV HSV) {
float h = hsv.h;
float s = hsv.s;
Float v = hsv.v;
int Hi = (int) ((H/60)% 6);
float f = (h/60)-Hi;
float p = v * (1-s);
float q = v * (1-F * s);
float T = v * (1-(1-f) * s);
Switch (Hi) {
Case 0:
Return Makecolor (V,T,P);
Case 1:
Return Makecolor (Q,V,P);
Case 2:
Return Makecolor (p,v,t);
Case 3:
Return Makecolor (P,Q,V);
Case 4:
Return Makecolor (T,P,V);
Default://Case 5:
Return Makecolor (V,P,Q);
}
Return Hsvtorgb (Hsv.h, Hsv.s, HSV.V). getRGB ();
}
Private Static Color Makecolor(float v, float v2, float v3) {
return New Color(v,v2,v3);
}
Reference
Color Space conversion of RGB to HSV (HSL) -jiangxinyu column - Blog channel -CSDN. Net.html
author:: Nickname :Old Wow's claws( Full Name::AttilaxAkbar Al Rapanui Attilaksachanui)
Kanji Name: Etila ( Ayron) , email:[email protected]
reprint Please indicate source: http://www.cnblogs.com/attilax/
Atiend
Atitit HSV-to-GRB should prioritize the use of the HSV color principle to facilitate human