Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.

Tip of the Day
Language: VB4,VB5,VB6,VBS
Expertise: beginner
Feb 19, 2000



Application Security Testing: An Integral Part of DevOps

Extract Red,Green,Blue components of a color

If you have a 32-bit color value in RGB format, you can extract its Red, Green and Blue components using the following routines:

Function GetRed(ByVal lColor As Long) As Long
    GetRed = lColor Mod 256
End Function

Function GetGreen(ByVal lColor As Long) As Long
    GetGreen = (lColor \ &H100) Mod 256
End Function

Function GetBlue(ByVal lColor As Long) As Long
    GetBlue = (lColor \ &H10000) Mod 256
End Function

Remember that you can combine the red, green and blue components into a RGB color using the built-in RGB function

rgbColor = RGB(redColor, greenColor, blueColor)
Marco Bellinaso
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.
Thanks for your registration, follow us on our social networks to keep up-to-date