warpengine

Generate a single random ESRI color

Discussion created by warpengine on Jan 10, 2013
I have this function from an old extension I wrote. It generates a single random ESRI color. I can't remember where I got it or how I came to this algorithm. Does anyone know if this is still valid with ArcGIS10 and VB2010.

    Public Function RandomColor() As ESRI.ArcGIS.Display.IRgbColor
        Randomize()

        Dim pRGB As ESRI.ArcGIS.Display.IRgbColor = New ESRI.ArcGIS.Display.RgbColor
        pRGB.RGB = CInt(16777214 * Rnd() + 1)

        Return pRGB
    End Function


~AGP

Outcomes