Curious, think I found my problem with my CGI not displaying the correct color, it was not GIVEN the correct color...
Now, for MOST colors this works fine.
But, launch this codea nd select pure black, it does not return anything....
And, in some colors it returns the wrong color, light blue might be a light pink, and if so, light pink returns light blue....
Weird....I'm not an RGB kind of guy, hehe, still learning this stuff but the function returns the color code in teh #XXXXXX format for use in web pages..
------------------
Scott
Now, for MOST colors this works fine.
But, launch this codea nd select pure black, it does not return anything....
And, in some colors it returns the wrong color, light blue might be a light pink, and if so, light pink returns light blue....
Weird....I'm not an RGB kind of guy, hehe, still learning this stuff but the function returns the color code in teh #XXXXXX format for use in web pages..
Code:
Case %ID_FONT_ALINK_BUTTON sTmp = GetColorSelection(CbHndl,LinkFG) If Len(sTmp) Then LinkFG = sTmp Control Set Text CbHndl,%ID_FONT_ALINK_TEXT,LinkFG End If ' ' ' '' '------------------------------------------------------------------------------------------ Function GetColorSelection(hWnd As Long,ByVal CurrentColor As String) As String Local ColorValue As Long Local sTmp As String CurrentColor = Remove$(CurrentColor,"#") ColorValue = SelectColor(hWnd,Val("&h" & CurrentColor),1) If IsTrue ColorValue Then sTmp = Hex$(ColorValue) 'Adds string "0" missing Function = "#" & String$(6 - Len(sTmp),"0") & sTmp End If End Function '----------------------------------------------------------------------------------------- Function SelectColor(ByVal hParent As Long, ByVal iStartColor As Long, ByVal iUseExt As Long) As Long Local cca As ChooseColorApi Dim ccTemp(16) As Static Dword cca.hinstance = 0 cca.lStructSize = SizeOf(cca) cca.lpCustColors = VarPtr(ccTemp(0)) '<-- !! cca.Flags = %CC_RGBINIT Or %CC_FULLOPEN Or %CC_ANYCOLOR If iUseExt = 0 Then cca.Flags = cca.Flags Or %CC_PREVENTFULLOPEN cca.hwndowner = hParent cca.rgbResult = iStartColor If ChooseColor(cca) Then Function = cca.rgbResult End Function '------------------------------------------------------------------------------------------
Scott
Comment