Voronoi diagram: Difference between revisions
Content added Content deleted
mNo edit summary |
(Updated D entry) |
||
Line 359: | Line 359: | ||
in size_t nx, in size_t ny) /*nothrow*/ { |
in size_t nx, in size_t ny) /*nothrow*/ { |
||
// Generate a random color for each centroid. |
// Generate a random color for each centroid. |
||
immutable rndRBG = (int) => RGB( |
immutable rndRBG = (int) => RGB(uniform!"[]"(ubyte.min, ubyte.max), |
||
uniform!"[]"(ubyte.min, ubyte.max), |
|||
uniform!"[]"(ubyte.min, ubyte.max)); |
|||
const colors = pts.length.iota.map!rndRBG.array; |
const colors = pts.length.iota.map!rndRBG.array; |
||