-
-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replaced OriginalWithModel ColorConverter with Gamut ColorConverter
- Loading branch information
1 parent
fe7617c
commit 239fa79
Showing
16 changed files
with
414 additions
and
283 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 5 additions & 4 deletions
9
...odel/Extensions/LightCommandExtensions.cs → ...amut/Extensions/LightCommandExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
src/Q42.HueApi.ColorConverters/Gamut/Extensions/LightExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using Q42.HueApi.Models.Gamut; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Q42.HueApi.ColorConverters.Gamut | ||
{ | ||
public static class LightExtensions | ||
{ | ||
public static string ToHex(this Light light) | ||
{ | ||
return light.ToHex(light.Capabilities?.Control?.ColorGamut); | ||
} | ||
|
||
public static string ToHex(this Light light, CIE1931Gamut? gamut) | ||
{ | ||
return HueColorConverter.HexFromState(light.State, gamut); | ||
} | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
src/Q42.HueApi.ColorConverters/Gamut/Extensions/StateExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using Q42.HueApi.Models.Gamut; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Q42.HueApi.ColorConverters.Gamut | ||
{ | ||
public static class StateExtensions | ||
{ | ||
public static string ToHex(this State state, CIE1931Gamut? gamut) | ||
{ | ||
return HueColorConverter.HexFromState(state, gamut); | ||
} | ||
|
||
public static RGBColor ToRgb(this State state, CIE1931Gamut? gamut) | ||
{ | ||
return HueColorConverter.RgbFromState(state, gamut); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.