✅ Help 2.0

Color accentColor = Properties.Settings.Default.accentColor;
string color = accentColor.ToString();
Color accentColor = Properties.Settings.Default.accentColor;
string color = accentColor.ToString();
This returns "Color [Red]" How do I make it return "Red"?
6 Replies
Jimmacle
Jimmacle3w ago
by manipulating the string to cut out the parts you don't want, that's just how ToString works for that type
Buddy
Buddy3w ago
Please don't name your thread "help" in the future, but be more descriptive
Jimmacle
Jimmacle3w ago
public override string ToString() =>
IsNamedColor ? $"{nameof(Color)} [{Name}]" :
(state & StateValueMask) != 0 ? $"{nameof(Color)} [A={A}, R={R}, G={G}, B={B}]" :
$"{nameof(Color)} [Empty]";
public override string ToString() =>
IsNamedColor ? $"{nameof(Color)} [{Name}]" :
(state & StateValueMask) != 0 ? $"{nameof(Color)} [A={A}, R={R}, G={G}, B={B}]" :
$"{nameof(Color)} [Empty]";
Gυαɾԃιαɳ
GυαɾԃιαɳOP3w ago
Sorry. It wont happen again Would this affect my other ToStrings?
Jimmacle
Jimmacle3w ago
that isn't code for you to use that's the implemention of ToString for Color
Gυαɾԃιαɳ
GυαɾԃιαɳOP3w ago
oo ok Ill use it to my advantage. Thanks for the help. Adios!
Want results from more Discord servers?
Add your server