https://m.qtccolor.com/tool/spectrum.aspx
目前上網找到相關的就只有這個網頁
但我將程式碼載下來,相關的js也載下來之後,發現右邊的色塊並沒有隨之改變
(中間的反射率不需要)
以往上網找範例網站都是html或php,這網址看起來是asp.net的網站,不知道有沒有關系。?
想請問有沒有其他相關範例
或是 其實將asp.net網站的程式碼載下來使用變成php檔其實是不行的??
能先解釋一下光譜值是什麼嗎www,每個顏色有幾個參數?
我只會色彩模型的轉換,下面例子是HSV和RGB之間的轉換:
function RGBtoHSV(r,g,b){
let max = Math.max(r,g,b);
let min = Math.min(r,g,b);
let h,s,v;
if(max == min){h = max/255*360;}
else if(max == r){h = 60 * ((g-b)/(max-min) % 6);}
else if(max == g){h = 60 * ((b-r)/(max-min) + 2);}
else if(max == b){h = 60 * ((r-g)/(max-min) + 4);}
if(max == 0) s = 0;
else s = (max - min) / max;
v = max / 255;
return {'H':h,'S':s,'V':v};
}
function HSVtoRGB(h,s,v){
let C = v * s;
let X = C * (1 - Math.abs((h / 60) % 2 - 1));
let m = v - C;
let R, G, B;
if(h < 60){R = C; G = X; B = 0;}
else if(h < 120){R = X; G = C; B = 0;}
else if(h < 180){R = 0; G = C; B = X;}
else if(h < 240){R = 0; G = X; B = C;}
else if(h < 300){R = X; G = 0; B = C;}
else if(h <= 360){R = C; G = 0; B = X;}
R = Math.floor((R + m) * 255);
G = Math.floor((G + m) * 255);
B = Math.floor((B + m) * 255);
return {'R':R,'G':G,'B':B};
}