Image
Interordi Menu
(O (O.O) O) §hmuİk
The Almighty Porcelain God
Inactive
221 posts
Quote

I was surfing through your site today and found this neat little HTML toy you made. The form is nice, but the preview and generate buttons should be further down. It was a bit confusing what I had to click. I have one question though, how do you program the colors in vb? I'm working on Body Builder and Table Maker in vb6 and was wondering. All I'm working with now are about 215 color cubes.


<font color=#00FF00>M</font><font color=#22DD00>e</font><font color=#44BB00>r</font><font color=#669900>r</font><font color=#887700>y</font><font color=#AA5500> </font><font color=#CC3300>C</font><font color=#EE1100>h</font><font color=#FF0000>r</font><font color=#FF0000>i</font><font color=#FF0000>s</font><font color=#FF0000>t</font><font color=#FF0000>m</font><font color=#FF0000>a</font><font color=#FF0000>s</font><font color=#FF0000>!</font>


My website has HTML Code Generators, what else do you want?

Staff Backer Doctacosa
Admin
SciLab Official
Benevolent Dictator
Offline
6346 posts
Princess Celestia
Princess Celestia
Got all items in the AFD2012 event!
Acquired on 1 April 2012
Unity.EXE emblem
Unity.EXE emblem
Defeat Bass.EXE in the AFD2013 event!
Acquired on 1 April 2013
Zenny
Zenny
Unlock all of the main forum features!
Acquired on 1 April 2014
Squid beaker
Squid beaker
Earned all 150 original CL achievements
Acquired on 17 January 2016
Lilly Satou
Lilly Satou
Acquired on 1 April 2012

... and 25 more
Quote

That little application is getting quite old, but it can still be useful. I use it from time to time to generate some special effects.

I'm including here the core of the code which manages loading the color dialog box and extracting the results in a common RPG format. This code was written for Visual Basic 6. You'll need to include the Microsoft Common Dialog Controls 6.0 (or something similar) in your project for this to work.

Quote:
'Get the currently entered color to set it as a default in the dialog box
color = val_red + (val_green * 256) + (val_blue * 256 ^ 2)

On Error GoTo ErrHandler
CommonDialog1.CancelError = True
CommonDialog1.Flags = cdlCCFullOpen
CommonDialog1.Color = color
CommonDialog1.ShowColor

'Open the color dialog box
color = CommonDialog1.Color

'Extract the three color components from the result number
If color > 65535 Then
val_blue = Int(color / (256 ^ 2))
val_green = Int((color - (val_blue * 65536)) / 256)
val_red = Int(color - (val_blue * 65536) - (val_green * 256))
ElseIf color > 255 Then
val_green = Int(color / 256)
val_red = (color - (val_green * 256))
Else
val_red = color
End If


The admin formerly known as Dr. Cossack.

I post musings, images and nonsense on Tumblr! I play games on Steam! Add me on either/both, and don't hesitate to ask if you want to play something with me!

"There are only three things certain in life: Death, taxes, and Teej's obsessions." ~ RisingDragon (still true in 2019!)