VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Change colors

by RickO`Shae (1 Submission)
Category: Graphics
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sun 4th August 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Change colors

API Declarations


Dim BLUE As Integer
Dim GREEN As Integer
Dim Rtog As Boolean
Dim Btog As Boolean
Dim Gtog As Boolean

Rate Change colors




Private Sub Timer1_Timer()
If Rtog = True Then
RED = RED + 4 * Rnd
Else: RED = RED - 4 * Rnd
End If
If RED > 255 Then Rtog = False
If RED < 10 Then Rtog = True

If Btog = True Then
BLUE = BLUE + 4 * Rnd
Else: BLUE = BLUE - 4 * Rnd
End If
If BLUE > 255 Then Btog = False
If BLUE < 10 Then Btog = True

If Gtog = True Then
GREEN = GREEN + 1 * Rnd
Else: GREEN = GREEN - 4 * Rnd
End If
If GREEN > 255 Then Gtog = False
If GREEN < 10 Then Gtog = True

Label1.ForeColor = RGB(RED, GREEN, BLUE)
End Sub



Download this snippet    Add to My Saved Code

Change colors Comments

No comments have been posted about Change colors. Why not be the first to post a comment about Change colors.

Post your comment

Subject:
Message:
0/1000 characters