Trovato.... faster than light
Non l'ho ancora provato ma mi incuriosisce il range di valori da 0 a 256...codice:Protected Function HexColGenerator() As String Dim RandomClass As New Random() Dim intR, intG, intB As Integer intR = RandomClass.Next(0, 256) intG = RandomClass.Next(0, 256) intB = RandomClass.Next(0, 256) Dim hexR, hexG, hexB As String hexR = intR.ToString("X").PadLeft(2, "0"c) hexG = intG.ToString("X").PadLeft(2, "0"c) hexB = intB.ToString("X").PadLeft(2, "0"c) Dim strColor As String = "" strColor = "#" & hexR & hexG & hexB Return strColor End Function

Rispondi quotando