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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 How to generate random ligh colors

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
yogiyang Posted - Sep 15 2017 : 02:32:41
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
2   L A T E S T    R E P L I E S    (Newest First)
yogiyang Posted - Sep 16 2017 : 02:23:17
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
xequte Posted - Sep 15 2017 : 16:25:56
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