Line | |
---|
1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Linq;
|
---|
4 | using System.Text;
|
---|
5 | using System.Windows.Media;
|
---|
6 |
|
---|
7 | namespace Microsoft.Research.DynamicDataDisplay.Common.Auxiliary
|
---|
8 | {
|
---|
9 | public static class ColorExtensions
|
---|
10 | {
|
---|
11 | public static Color MakeTransparent(this Color color, int alpha)
|
---|
12 | {
|
---|
13 | color.A = (byte)alpha;
|
---|
14 | return color;
|
---|
15 | }
|
---|
16 |
|
---|
17 | public static Color MakeTransparent(this Color color, double opacity)
|
---|
18 | {
|
---|
19 | return MakeTransparent(color, (int)(255 * opacity));
|
---|
20 | }
|
---|
21 | }
|
---|
22 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.