Skip to content

Commit 6899b1e

Browse files
committed
Windows fixes
1 parent 096b98f commit 6899b1e

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

ColorSet.sln

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 15
4-
VisualStudioVersion = 15.0.28307.572
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.29025.244
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ColorSetKit", "ColorSetKit\ColorSetKit.csproj", "{E3BF32CB-99E2-4331-AFB6-9281D79E63BC}"
77
EndProject

ColorSetKit/Color.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,13 @@ public override object ProvideValue( IServiceProvider provider )
8181
{
8282
NameComponents components = this.ComponentsForColorName( this.Name );
8383

84-
if( !( ColorSet.Shared.ColorNamed( this.Name ) is ColorPair pair ) )
84+
if( !( ColorSet.Shared.ColorNamed( components.Name ) is ColorPair pair ) )
8585
{
8686
return this.Fallback;
8787
}
8888

89-
ColorExtension.HSLComponents hsl = pair.Color?.Color.GetHSL() ?? new ColorExtension.HSLComponents { Hue = 0, Saturation = 0, Lightness = 0, Alpha = 0 };
90-
double? lightness = components.Lightness;
89+
ColorExtensions.HSLComponents hsl = pair.Color?.Color.GetHSL() ?? new ColorExtensions.HSLComponents { Hue = 0, Saturation = 0, Lightness = 0, Alpha = 0 };
90+
double? lightness = components.Lightness;
9191

9292
if( components.Variant is string v )
9393
{
@@ -139,7 +139,7 @@ public override object ProvideValue( IServiceProvider provider )
139139
}
140140
}
141141

142-
return ( pair.Color == null ) ? null : new SolidColorBrush( pair.Color.Color.ByChangingLightness( l ) );
142+
return ( pair.Color == null ) ? this.Fallback : new SolidColorBrush( pair.Color.Color.ByChangingLightness( l ) );
143143
}
144144

145145
if( this.Variant && pair.Variant is SolidColorBrush variant )
@@ -156,7 +156,7 @@ public string Name
156156
get;
157157
set;
158158
}
159-
159+
160160
[ConstructorArgument( "variant" )]
161161
public bool Variant
162162
{
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
namespace ColorSetKit
3131
{
32-
public static class ColorExtension
32+
public static class ColorExtensions
3333
{
3434
private struct HSL
3535
{
@@ -70,7 +70,7 @@ public static System.Windows.Media.Color FromHSL( double hue, double saturation,
7070
R = ( byte )( Math.Floor( rgb.Red * 255 ) ),
7171
G = ( byte )( Math.Floor( rgb.Green * 255 ) ),
7272
B = ( byte )( Math.Floor( rgb.Blue * 255 ) ),
73-
A = ( byte )( Math.Floor( alpha * 255 ) )
73+
A = ( byte )( Math.Floor( alpha * 100 ) )
7474
};
7575
}
7676

ColorSetKit/ColorSetKit.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
</ItemGroup>
4646
<ItemGroup>
4747
<Compile Include="Color.cs" />
48-
<Compile Include="ColorExtension.cs" />
48+
<Compile Include="ColorExtensions.cs" />
4949
<Compile Include="ColorPair.cs" />
5050
<Compile Include="ColorSet.cs" />
5151
<Compile Include="ColorSetStream.cs" />

0 commit comments

Comments
 (0)