如何獲取r,g,b值並將它們與網頁安全調色板進行比較以找到r,g,b值的最佳匹配? 有這樣一條: What is the best algorithm for finding the closest color in an array to another color? 但我不認爲這是我需要什麼。我只需要將r,g,b與網頁安全色進行比較,找出網頁安全色是否是最佳選擇。 EDIT1:刪除 EDIT2
我在訪問不同地方定義的javascript函數時有兩個看似相關的問題。我遇到的第一個問題是調用我從firgbug或safari控制檯定義的函數。我定義了一個名爲getRed看起來像這樣的功能: function getRed(row, col)
{
// do something stuff and return the red value as a float