mirror of
https://github.com/ShareX/ShareX.git
synced 2024-09-30 01:07:21 +13:00
Support hex colors which start with 0x
This commit is contained in:
parent
04b925a8bd
commit
702bc0b066
1 changed files with 4 additions and 0 deletions
|
@ -155,6 +155,10 @@ public static Color HexToColor(string hex, ColorFormat format = ColorFormat.RGB)
|
|||
{
|
||||
hex = hex.Remove(0, 1);
|
||||
}
|
||||
else if (hex.StartsWith("0x", StringComparison.InvariantCultureIgnoreCase))
|
||||
{
|
||||
hex = hex.Remove(0, 2);
|
||||
}
|
||||
|
||||
if (((format == ColorFormat.RGBA || format == ColorFormat.ARGB) && hex.Length != 8) ||
|
||||
(format == ColorFormat.RGB && hex.Length != 6))
|
||||
|
|
Loading…
Reference in a new issue