Ruby, Generate a random hex color (only light colors)

前端 未结 6 2089
甜味超标
甜味超标 2021-01-07 01:49

I know this is possible duplicated question. Ruby, Generate a random hex color

My question is slightly different. I need to know, how to generate the random hex lig

6条回答
  •  庸人自扰
    2021-01-07 02:23

    -- I found that 128 to 256 gives the lighter colors

        Dim rand As New Random
        Dim col As Color
        col = Color.FromArgb(rand.Next(128, 256), rand.Next(128, 256), rand.Next(128, 256))
    

提交回复
热议问题