rando color
Posted: Wed Jan 10, 2018 10:44 pm
I have an archive where I put a field ncolor ( numeric) to show a color but when I insert a record it is allways black because the fields is empty (0) .
How I can to rando a color different every time I insert a new record ?
Any nice solution ?
I made this
but I have often the same or similar color
How I can to rando a color different every time I insert a new record ?
Any nice solution ?
I made this
- Code: Select all Expand view
- Function Rando_Color(nColor)
nRed:=HB_Random(0, 255 )
nBlue:=HB_Random(0, 255 )
nGia:=HB_Random(0, 255 )
nColor:= nrgb(nRed,nGia,nBlue)
msginfo(ncolor)
return nColor
but I have often the same or similar color