Internal: Rename kd3_color to kcolor.

Also simplify and correct gamma handling.
Ordered dither improvements: Add halftone dithers.

Halftone pattern "half,20" is a 20-pixel triangular halftone.
"sqhalf,8,3" is an 8-pixel square halftone with 3 colors per cell.

And add a much-improved algorithm for picking two or three colors. Use
point-to-line and point-to-plane algorithms to pick the color
combination that comes closest to the input color.