Hi
Ich habe einen Fehler den ich irgendwie nicht ganz versteh: Ich hab bei meiner IniLib ja als Angebot eine Methode namens ColorToString reingebaut. Das funktioniert aber nicht ganz(wie so manches ;)). Die Funktion sieht so aus:
jetzt ist da allerdings der Fehler, dass das Ergebnis falsch ist. Was mache ich da falsch?
Der Fehler scheint beim ColorToString-Aufruf zu liegen, da für die Farbe Color.FromArgb(0, 0, 128) (Dunkelblau) 128,0,128(Violett) herauskommt. Es sieht so aus, dass da R falsch eingesetzt wird. Aber da fällt mir bei meinem Code nichts auf...
Gruß
~blaze~
Ich habe einen Fehler den ich irgendwie nicht ganz versteh: Ich hab bei meiner IniLib ja als Angebot eine Methode namens ColorToString reingebaut. Das funktioniert aber nicht ganz(wie so manches ;)). Die Funktion sieht so aus:
VB.NET-Quellcode
- Public Shared Function ColorToString(ByVal Color As Color, Optional ByVal Pattern As String = "[R],[G],[B]") As String
- Dim Retval As String = Pattern
- Retval = Regex.Replace(Retval, "\[ARGB\]", Color.ToArgb.ToString, RegexOptions.IgnoreCase)
- Retval = Regex.Replace(Retval, "\[BR\]", Color.GetBrightness.ToString, RegexOptions.IgnoreCase)
- Retval = Regex.Replace(Retval, "\[A\]", Color.A.ToString, RegexOptions.IgnoreCase)
- Retval = Regex.Replace(Retval, "\[R\]", Color.R.ToString, RegexOptions.IgnoreCase)
- Retval = Regex.Replace(Retval, "\[G\]", Color.G.ToString, RegexOptions.IgnoreCase)
- Retval = Regex.Replace(Retval, "\[B\]", Color.B.ToString, RegexOptions.IgnoreCase)
- Retval = Regex.Replace(Retval, "\[H\]", Color.GetHue.ToString, RegexOptions.IgnoreCase)
- Retval = Regex.Replace(Retval, "\[S\]", Color.GetSaturation.ToString, RegexOptions.IgnoreCase)
- Return Retval
- End Function
jetzt ist da allerdings der Fehler, dass das Ergebnis falsch ist. Was mache ich da falsch?
Der Fehler scheint beim ColorToString-Aufruf zu liegen, da für die Farbe Color.FromArgb(0, 0, 128) (Dunkelblau) 128,0,128(Violett) herauskommt. Es sieht so aus, dass da R falsch eingesetzt wird. Aber da fällt mir bei meinem Code nichts auf...
Gruß
~blaze~