Skip to content
This repository was archived by the owner on Jan 13, 2024. It is now read-only.

Commit ee531d9

Browse files
authored
Merge pull request #36 from jokedst/ColourFix
Fix for #34 - made sure Colour(X).Value = X
2 parents 8898006 + d8cd8b6 commit ee531d9

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Visual Studio Project Template C#/PluginInfrastructure/GatewayDomain.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ public class Colour
1616
public readonly int Red, Green, Blue;
1717

1818
public Colour(int rgb)
19-
{
20-
Red = rgb ^ 0xFF;
21-
Green = rgb ^ 0x00FF;
22-
Blue = rgb ^ 0x0000FF;
23-
}
19+
{
20+
Red = rgb & 0xFF;
21+
Green = (rgb >> 8) & 0xFF;
22+
Blue = (rgb >> 16) & 0xFF;
23+
}
2424

2525
/// <summary>
2626
///
@@ -43,7 +43,7 @@ public Colour(int red, int green, int blue)
4343

4444
public int Value
4545
{
46-
get { return Red + (Blue << 8 ) + (Green << 16); }
46+
get { return Red + (Green << 8) + (Blue << 16); }
4747
}
4848
}
4949

0 commit comments

Comments
 (0)