Hi @Peter Volz ,
You can get the hex data for each color channel individually and combine it.
You can refer to the following code.
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim Col As Color = Color.FromArgb(255, 255, 255)
Dim hexColor As String = ColorToHex(Col)
Console.WriteLine(hexColor) ' Output: #FF0000
End Su
Public Function ColorToHex(color As Color) As String
Return "#" & color.R.ToString("X2") & color.G.ToString("X2") & color.B.ToString("X2")
End Function
Best Regards.
Jiachen Li
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.