Find Code:
All Words
Any of the Words
Exact Phrase
Home
:
Code
:
Forums
:
Submit
:
Mailing List
:
About
:
Contact
Code
All
VB.NET
ASP.NET
C#
VB Classic
ASP Classic
Snippets
Popular
Resources
Submit Code
Forums
Articles
Tips
Links
Books
Contest
Link to us
This function converts a color (long value) to a R...
Author:
Samitha
E-mail:
Click to e-mail author
Submitted:
6/12/2002
Version:
VB5
Compatibility:
VB5, VB6
Category:
Graphics
Views:
8288
This function converts a color (long value) to a RGB String.
Declarations:
'none
Code:
Public Function getRGB(RGBLong As Long) As String Dim intRed As Integer Dim intGreen As Integer Dim intBlue As Integer Dim strHexVal As String Dim strOneSet As String strHexVal = CStr(Hex(RGBLong)) 'fix the length of the colour value Do While Len(strHexVal) < 6 strHexVal = "0" & strHexVal Loop strOneSet = Mid(strHexVal, 5, 2) intRed = CLng("&h" & strOneSet) strOneSet = Mid(strHexVal, 3, 2) intGreen = CLng("&h" & strOneSet) strOneSet = Mid(strHexVal, 1, 2) intBlue = CLng("&h" & strOneSet) getRGB = "RGB(" & intRed & "," & intGreen & "," & intBlue & ")" End Function
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2024 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement