From 18e956f34c63ca4a4b6a422abdadfdaccaf83b61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A0=B4=E5=A8=83=E9=85=B1?= Date: Mon, 2 Jan 2017 15:19:23 +0800 Subject: [PATCH] not set alpha of the icon (#981) --- shadowsocks-csharp/View/MenuViewController.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/shadowsocks-csharp/View/MenuViewController.cs b/shadowsocks-csharp/View/MenuViewController.cs index 869278de..68f3c93c 100644 --- a/shadowsocks-csharp/View/MenuViewController.cs +++ b/shadowsocks-csharp/View/MenuViewController.cs @@ -197,11 +197,16 @@ namespace Shadowsocks.View for (int y = 0; y < iconCopy.Height; y++) { Color color = originIcon.GetPixel(x, y); - if (color.A != 0 && color.R > 30) + if (color.A != 0) { 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) {