From RGB to Color

maxpic55

Newcomer
Joined
Dec 16, 2002
Messages
15
Hello,
How can I do? I want to put a color with a random function like as:

Dim pens As New Pen(Color.Violet)
Dim a As Random
pens.Color=RGB(a.Next(1,255),a.Next(1,255),a.Next(1,255))

It's possible to convert this value integer in System.Drawing.Color?

Thank you.

Maxpic55
 
Use Color.FromARGB(a.Next(1,255), a.Next(1,255), a.Next(1,255))
and it will return a Drawing.Color object.
 
Back
Top