ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 How to generate random ligh colors
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

yogiyang

India
725 Posts

Posted - Sep 15 2017 :  02:32:41  Show Profile  Reply
Hello,

I have a need where in I have to show swatches of colors from which user will select a color which is then used as background color.

I have to generate randomly 100 color swatches and these colors should always be light so that text on them is clearly visible. For example Light Blue, Light Brown, Light Pink, etc. shades.

Any ideas as to how we can generate 100 random Light colors and show them as swatches in ImageEn?

TIA


Yogi Yang

xequte

38180 Posts

Posted - Sep 15 2017 :  16:25:56  Show Profile  Reply
Hi Yogi

Light colors are ones where all the R,G and B values are high, e.g. > 200. So you could write some method to generate a list of colors with high RGB values and then display them in the TIEColorPalette:



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

yogiyang

India
725 Posts

Posted - Sep 16 2017 :  02:23:17  Show Profile  Reply
Thanks Nigel,

Now you have got me started!

Here is what I am going to do:
Generate random values between 200 and 255 for each channel (RGB) and build a set of random light colors.

TIA



Yogi Yang
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: