Browse Source

not set alpha of the icon (#981)

tags/3.4.3
破娃酱 Syrone Wong 8 years ago
parent
commit
18e956f34c
1 changed files with 7 additions and 2 deletions
  1. +7
    -2
      shadowsocks-csharp/View/MenuViewController.cs

+ 7
- 2
shadowsocks-csharp/View/MenuViewController.cs View File

@@ -197,11 +197,16 @@ namespace Shadowsocks.View
for (int y = 0; y < iconCopy.Height; y++) for (int y = 0; y < iconCopy.Height; y++)
{ {
Color color = originIcon.GetPixel(x, y); Color color = originIcon.GetPixel(x, y);
if (color.A != 0 && color.R > 30)
if (color.A != 0)
{ {
if (!enabled) if (!enabled)
{ {
iconCopy.SetPixel(x, y, Color.FromArgb((byte)(color.A / 1.25), color.R, color.G, color.B));
Color flyBlue = Color.FromArgb(192, 192, 192);
// Multiply with flyBlue
int red = color.R * flyBlue.R / 255;
int green = color.G * flyBlue.G / 255;
int blue = color.B * flyBlue.B / 255;
iconCopy.SetPixel(x, y, Color.FromArgb(color.A, red, green, blue));
} }
else if (global) else if (global)
{ {


Loading…
Cancel
Save