Select to view content in your preferred language

Generate a single random ESRI color

502
0
01-10-2013 10:11 AM
AbelPerez
Frequent Contributor
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
0 Kudos
0 Replies