RGB2HEX

    • VB.NET
      Hey Leute,
      hier ein Code mit dem man RGB zu HEX Umwandeln kann:

      VB.NET-Quellcode

      1. Dim CLRDialog As New ColorDialog
      2. If CLRDialog.ShowDialog = Windows.Forms.DialogResult.OK Then
      3. Dim Farbe As Color = CLRDialog.Color
      4. Dim R = Hex(Farbe.R)
      5. Dim G = Hex(Farbe.G)
      6. Dim B = Hex(Farbe.B)
      7. If R.Length < 2 Then
      8. R = R.Insert(0, "0")
      9. End If
      10. If G.Length < 2 Then
      11. G = G.Insert(0, "0")
      12. End If
      13. If B.Length < 2 Then
      14. B = B.Insert(0, "0")
      15. End If
      16. MsgBox("RGB: " & Farbe.R & ", " & Farbe.G & ", " & Farbe.B & Chr(13) & _
      17. "HEX: " & R & ", " & G & ", " & B)
      18. End If


      Ich hoffe ihr könnt damit etwas anfangen

      lg.