- Public Function ColorTranslation(ByVal ColorInt As Integer) As Color
- If Math.Sign(ColorInt) = -1 Then
- Return Color.FromArgb(ColorInt)
- Else
- Dim A, R, G, B As Integer
-
- Dim STColor As String = System.Convert.ToString(ColorInt, 16)
- STColor = STColor.PadLeft(6, "0"c)
- A = 255
- B = System.Convert.ToInt32(STColor.Substring(0, 2), 16)
- G = System.Convert.ToInt32(STColor.Substring(2, 2), 16)
- R = System.Convert.ToInt32(STColor.Substring(4, 2), 16)
-
- Return System.Drawing.Color.FromArgb(A, R, G, B)
- End If
-
- End Function
Public Function ColorTranslation(ByVal ColorInt As Integer) As Color
If Math.Sign(ColorInt) = -1 Then
Return Color.FromArgb(ColorInt)
Else
Dim A, R, G, B As Integer
Dim STColor As String = System.Convert.ToString(ColorInt, 16)
STColor = STColor.PadLeft(6, "0"c)
A = 255
B = System.Convert.ToInt32(STColor.Substring(0, 2), 16)
G = System.Convert.ToInt32(STColor.Substring(2, 2), 16)
R = System.Convert.ToInt32(STColor.Substring(4, 2), 16)
Return System.Drawing.Color.FromArgb(A, R, G, B)
End If
End Function