VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Darkens/Lightens a color by percentage. Go to http://gameday.de/galaxy/ to help in the beta-testing

by Walter Eigner (15 Submissions)
Category: Graphics
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sun 7th December 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Darkens/Lightens a color by percentage. Go to https://gameday.de/galaxy/ to help in the beta-testing of a game designed in vb 6.0 - Galaxy.

Rate Darkens/Lightens a color by percentage. Go to http://gameday.de/galaxy/ to help in the beta-testing



Dim r1 As Long
Dim g1 As Long
Dim b1 As Long
b1 = color \ 65536
g1 = (color - b1 * 65536) \ 256
r1 = color - b1 * 65536 - g1 * 256
r1 = Abs(r1 * percentage)
g1 = Abs(g1 * percentage)
b1 = Abs(b1 * percentage)
If r1 > 255 Then r1 = 255
If g1 > 255 Then g1 = 255
If b1 > 255 Then b1 = 255
darkenColor = RGB(Int(r1), Int(g1), Int(b1))
End Function

Download this snippet    Add to My Saved Code

Darkens/Lightens a color by percentage. Go to http://gameday.de/galaxy/ to help in the beta-testing Comments

No comments have been posted about Darkens/Lightens a color by percentage. Go to http://gameday.de/galaxy/ to help in the beta-testing. Why not be the first to post a comment about Darkens/Lightens a color by percentage. Go to http://gameday.de/galaxy/ to help in the beta-testing.

Post your comment

Subject:
Message:
0/1000 characters