|
-
Feb 27th, 2000, 04:43 AM
#1
how can i change the decimal colors returned by the color dialog into colors like 255,255,255?
-
Feb 27th, 2000, 07:11 PM
#2
Hyperactive Member
Hello sailbrdr,
Try this source:
Dim Str As String
Dim N As Integer
Dim Rdec, Gdec, Bdec As Single
Dim Rhex, Ghex, Bhex As String
'N is the variable to convert
N = Val("&H" + "fF")
Str = Right("00000" + Hex(N), 6)
Rhex = "&H" + Left(Str, 2)
Rdec = Val(Rhex)
Ghex = "&H" + Mid(Str, 3, 2)
Gdec = Val(Ghex)
Bhex = "&H" + Right(Str, 2)
Bdec = Val(Bhex)
Good luck,
Michelle
-
Feb 29th, 2000, 07:49 AM
#3
-
Feb 29th, 2000, 04:39 PM
#4
Lively Member
Test this
Dim iR as Integer
Dim iG as Integer
Dim iB as Integer
Dim sRHex as String
Dim sGHex as String
Dim sBHex as String
If Len(Hex(iR)) < 2 Then
sRHex = "0" & Hex(iR)
Else
sRHex = Hex(iR)
End If
If Len(Hex(iG)) < 2 Then
sGHex = "0" & Hex(iG)
Else
sGHex = Hex(iG)
End If
If Len(Hex(iB)) < 2 Then
sBHex = "0" & Hex(iB)
Else
sBHex = Hex(iB)
End If
-
Feb 29th, 2000, 04:59 PM
#5
Hyperactive Member
Maybe this:
Dim N As Long
Dim Rdec, Gdec, Bdec As Single
Dim Rhex, Ghex, Bhex As String
Dim STR As String
'N is the variable to convert
N = Val("&H" + "FF01FF")
STR = Right("00000" + Hex(N), 6)
Rhex = "&H" + Left(STR, 2)
Rdec = Val(Rhex)
Ghex = "&H" + Mid(STR, 3, 2)
Gdec = Val(Ghex)
Bhex = "&H" + Right(STR, 2)
Bdec = Val(Bhex)
Rhex = Trim(Left(STR, 2))
Ghex = Trim(Mid(STR, 3, 2))
Bhex = Trim(Right(STR, 2))
'------------------------------------------
Rhex = Right(("0" + Rhex), 2)
Ghex = Right(("0" + Ghex), 2)
Bhex = Right(("0" + Bhex), 2)
N = Val("&H" + Rhex + Ghex + Bhex)
Good luck,
Michelle.
-
Mar 1st, 2000, 04:40 AM
#6
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|