132133134135136137138139140141142
// Generate new Color Palette int r, g, b; float rf, gf, bf; double diff, nearestDiff; MapColor nearest = null; for (r = 0; r < 256; r++) { rf = (float) r / 255f; for (g = 0; g < 256; g++) { gf = (float) g / 255f; for (b = 0; b < 256; b++) {