Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2.0.0 #364

Merged
merged 146 commits into from
Dec 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
146 commits
Select commit Hold shift + click to select a range
d60d483
Reduced some allocations mostly due to boxing
DarthAffe Feb 5, 2023
7c165f5
Add new PID to list of known Lightspeed Receivers
motabass Feb 5, 2023
b779b58
Merge pull request #290 from DarthAffe/Core/Optimizations
DarthAffe Feb 5, 2023
287e393
Merge pull request #292 from motabass/master
DarthAffe Feb 5, 2023
3aba170
Update RazerDeviceProvider.cs
logicallysynced Feb 6, 2023
43ecc73
Update RazerDeviceProvider.cs
logicallysynced Feb 6, 2023
180b0e4
Updated corsair SDK to iCUE SDK v4.0.48
DarthAffe Feb 10, 2023
d6aed5c
Fixed some code issues (dispose finalizers)
DarthAffe Feb 10, 2023
2ff7a65
Removed editorconfig
DarthAffe Feb 10, 2023
3ffa834
Merge pull request #297 from DarthAffe/SDK/Corsair
DarthAffe Feb 11, 2023
3ff3572
Merge pull request #294 from roxaskeyheart/patch-2
DarthAffe Feb 11, 2023
8431a8c
(MAJOR) Optimized surface-updating to reduce the amount of allocations
DarthAffe Feb 11, 2023
df73551
Merge pull request #298 from DarthAffe/Core/Optimizations
DarthAffe Feb 11, 2023
38840ef
Asus dev
logicallysynced Feb 12, 2023
3dc4f45
Merge branch 'Development' of https://github.com/DarthAffe/RGB.NET in…
logicallysynced Feb 12, 2023
df2f562
Update AsusDeviceProvider.cs
logicallysynced Feb 12, 2023
914bd8c
Update AsusDeviceProvider.cs
logicallysynced Feb 12, 2023
b67294e
Added missing G915 TKL PID
motabass Feb 12, 2023
db2f16d
Update RGB.NET.Devices.Asus/AsusDeviceProvider.cs
DarthAffe Feb 12, 2023
631c8d2
Merge pull request #299 from roxaskeyheart/Development
DarthAffe Feb 12, 2023
d66e4d8
Merge pull request #300 from motabass/master
DarthAffe Feb 12, 2023
cc652a0
Added corsair session details
DarthAffe Feb 12, 2023
bb3b74b
Removed debug output
DarthAffe Feb 12, 2023
6e313ea
Merge pull request #301 from DarthAffe/SDK/Corsair
DarthAffe Feb 12, 2023
37e4954
Added exception-handling to all UpdateQueues
DarthAffe Mar 5, 2023
1b4b92b
Merge pull request #303 from DarthAffe/DeviceExceptionHandling
DarthAffe Mar 5, 2023
30ccfdc
(MAJOR) Added success-indication to device updates and forced flushes…
DarthAffe Mar 5, 2023
4a9bbb6
Added missing doc comment
DarthAffe Mar 5, 2023
4675349
Merge pull request #304 from DarthAffe/DeviceExceptionHandling
DarthAffe Mar 5, 2023
b6342ea
Wooting - Add macOS dylib
diogotr7 Mar 9, 2023
1793d26
OpenRgb - added segments
diogotr7 Mar 9, 2023
5eb39b1
Added Pid for Razer BlackWidow V4
DarthAffe Mar 14, 2023
f089c61
Merge pull request #307 from diogotr7/feature/wooting-macos
DarthAffe Mar 14, 2023
12d6b90
Merge pull request #306 from diogotr7/feature/openrgb.net-2
DarthAffe Mar 14, 2023
39cfcdb
Merge pull request #308 from DarthAffe/SDK/RazerPids
DarthAffe Mar 14, 2023
d054d16
Added reference counting to update queues to prevent premature dispos…
DarthAffe Apr 7, 2023
5b514ff
Moved reference check for UpdateQueue disposal to the caller to preve…
DarthAffe Apr 8, 2023
818678f
Added PID for Razer Ornata V3
DarthAffe Apr 8, 2023
b7df7e4
Merge pull request #310 from DarthAffe/SDK/RazerPids
DarthAffe Apr 8, 2023
10183fb
Added dispose-check to corsairs update queue
DarthAffe Apr 9, 2023
6bed690
Merge pull request #311 from DarthAffe/DisposeFix
DarthAffe Apr 10, 2023
aaabbc6
(MAJOR): Removed support for .NET 5; Updated nugets; Removed the not …
DarthAffe Apr 10, 2023
02235a3
Fixed some code-issues
DarthAffe Apr 10, 2023
82050b8
Fixed some code issues
DarthAffe Apr 10, 2023
f6433af
Merge branch 'Development' into SomeFixes
DarthAffe Apr 10, 2023
4216dac
Removed unnecessary contains check in AbstractReferenceCounting
DarthAffe Apr 10, 2023
764fcd1
(MAJOR) Improved update performance of devices
DarthAffe Apr 12, 2023
0cf4f39
Reduced allocations when a ListLedGroup is used
DarthAffe Apr 12, 2023
70ccc4d
Reduced some more allocations
DarthAffe Apr 12, 2023
4ee55c6
Small fixes
DarthAffe Apr 12, 2023
260a820
Added SkipLocalsInitAttribute to Sample-Methods
DarthAffe Apr 13, 2023
ad75707
Removed SkipLocalInit-Attributes - they're causing issues and are not…
DarthAffe Apr 13, 2023
d9c244a
Small fixes
DarthAffe Apr 19, 2023
2020992
Sealed a lot of classes that are not meant to be inherited
DarthAffe Apr 19, 2023
25fef22
Merge pull request #313 from DarthAffe/Test/PerformanceOptimization
DarthAffe Apr 19, 2023
e8f168f
Removed .NET 5 artifacts from build
DarthAffe Apr 19, 2023
f5f81e7
Merge pull request #315 from DarthAffe/Workflows
DarthAffe Apr 19, 2023
af3989a
Added Test for the PixelTexture
DarthAffe Apr 23, 2023
586734b
(MAJOR) Improvied sampling performance by removing the need to copy r…
DarthAffe Apr 23, 2023
928d5c2
Added license link to SimplexNoise
DarthAffe Apr 23, 2023
54f39f8
Merge pull request #316 from DarthAffe/RenderPerformance
DarthAffe Apr 23, 2023
9f8e64f
Changed DataPerPixel and Stride to be protected in PixelTexture
DarthAffe Apr 23, 2023
346d502
Merge pull request #317 from DarthAffe/RenderPerformance
DarthAffe Apr 23, 2023
a219484
Changed stride and DataPerPixel in the PixelTexture to be a property …
DarthAffe Apr 23, 2023
4a0ae1a
Merge pull request #318 from DarthAffe/RenderPerformance
DarthAffe Apr 23, 2023
93cd805
Simplified span-fixes in Samplers
DarthAffe Apr 24, 2023
0c8f48e
Asus - Modify device type enum to add new items
DragRedSim May 2, 2023
e9cd657
Asus - Corrected unspecified device documentation
DragRedSim May 2, 2023
184a582
Asus - added LED mapping for ROG Strix G15 (2021)
DragRedSim May 2, 2023
acddfed
Removed allocation when applying decorators
DarthAffe May 8, 2023
7e72d31
Added DevicesChanged-event to device providers
DarthAffe May 8, 2023
67f3625
Changed device lists in the DevicesChanged-event to readonly
DarthAffe May 8, 2023
4684e29
Changed DevicesChanged-event to provide a single device instead of a …
DarthAffe May 8, 2023
124f76b
Fixed comment
DarthAffe May 8, 2023
73b7f1f
Changed Bindable-Methods to not be virtual since there is not really …
DarthAffe May 8, 2023
a196d2a
Changed the calculation mode of the SolidColor-brush to absolute for …
DarthAffe May 8, 2023
d538011
Add more Razer Keyboard HIDs
logicallysynced May 11, 2023
b90c470
Changed DevicesChangedEventArgs to only contain the device causing th…
DarthAffe May 15, 2023
1532e31
Improved Stop of DeviceUpdateTrigger
DarthAffe May 15, 2023
020f249
Merge pull request #322 from DarthAffe/NativeStuff
DarthAffe May 20, 2023
0aca2d8
Apply suggestions from code review
DarthAffe May 20, 2023
27018b3
Merge pull request #325 from roxaskeyheart/patch-3
DarthAffe May 20, 2023
79252d5
Merge pull request #319 from DragRedSim/asus-rog-strix-laptop
DarthAffe May 20, 2023
5dbcd9c
Added SteelSeries Aerox 5 Wireless #323
DarthAffe May 20, 2023
e96e1d6
Merge pull request #328 from DarthAffe/Steelseries/Devices
DarthAffe May 21, 2023
e547bae
Update OpenRGB.NET nuget
diogotr7 May 23, 2023
a0bdd83
Merge pull request #329 from diogotr7/feature/update-openrgb-net
DarthAffe May 23, 2023
ca3c9fc
WIP - Fixed corsair partial devices getting longer
diogotr7 Jun 2, 2023
d7fffb4
Added comment to new corsai FixOffsetDeviceLayout-method
DarthAffe Jun 3, 2023
83bdfea
Merge pull request #321 from DarthAffe/Core/DevicesChangedEvent
DarthAffe Jun 3, 2023
bf71132
Added more Razer keyboard and mouse PIDs
RobertBeekman Jun 11, 2023
4fb1dca
Merge pull request #333 from DarthAffe/razer-pids
DarthAffe Jun 11, 2023
2b203b2
Fix duplicate
RobertBeekman Jun 12, 2023
88a0f0f
Merge pull request #334 from DarthAffe/razer-pids
DarthAffe Jun 12, 2023
56d77de
Merge pull request #331 from diogotr7/feature/corsair-size
DarthAffe Jun 12, 2023
fdc69fd
Implemented recommended dispose pattern for DeviceProviders
DarthAffe Jun 15, 2023
0609e49
Added locks around device provider instance usages
DarthAffe Jun 18, 2023
ba99ecf
Layout - Allow loading directly from a stream
RobertBeekman Jul 9, 2023
803acf2
Added Razer Blade 16 PID
DELUUXE Jul 22, 2023
6f91af9
Readded support for older CUE-SDKs
DarthAffe Jul 23, 2023
8faedd1
Fixed error in solution
DarthAffe Jul 23, 2023
89ab79a
Merge pull request #342 from DarthAffe/SDK/CorsairLegacy
DarthAffe Jul 23, 2023
d85d289
Merge pull request #341 from DELUUXE/Development
DarthAffe Jul 23, 2023
fd6bfa0
Merge pull request #340 from DarthAffe/feature/layout-from-stream
DarthAffe Jul 23, 2023
5483a75
Added custom led mapping for Razer Blade keyboards
DELUUXE Jul 24, 2023
2a2053c
Applied Led-Position-Fix from #331 to Corsair-Legacy-DeviceProvider
DarthAffe Jul 25, 2023
b4bbc6a
Merge pull request #345 from DarthAffe/SDK/CorsairLegacy
DarthAffe Jul 25, 2023
7415c6b
Merge pull request #343 from DELUUXE/BladeLedMapping
DarthAffe Jul 25, 2023
4209905
Merge pull request #336 from DarthAffe/ProviderInit
DarthAffe Aug 16, 2023
2c8bc72
Added missing provider-init-changes to CorsairLegacy
DarthAffe Aug 16, 2023
d070f0b
Merge pull request #347 from DarthAffe/ProviderInit
DarthAffe Aug 16, 2023
1f0b1b0
Fixed an exception when multiple invalid leds are present in custom c…
DarthAffe Aug 17, 2023
3d9706a
Merge pull request #348 from DarthAffe/SDK/Corsair
DarthAffe Aug 19, 2023
aba0888
Fixed typo in Core readme
DarthAffe Aug 22, 2023
5d3a361
Added PID for Razer Black Widow V4 75%
DarthAffe Aug 22, 2023
3461674
Typo in Keyboard name
DarthAffe Aug 22, 2023
9d1188a
Fixed razer naming again
DarthAffe Aug 22, 2023
7453644
Merge pull request #349 from DarthAffe/RazerPids
DarthAffe Aug 22, 2023
c7abac5
Update RazerDeviceProvider.cs
logicallysynced Aug 23, 2023
60892e4
Merge pull request #350 from roxaskeyheart/razer-blackwidowv4-pid
DarthAffe Aug 23, 2023
72da2b6
Added LedIds for Indicator-LEDs (like NumLock)
DarthAffe Aug 27, 2023
5707a24
Removed excessive spaces
DarthAffe Aug 27, 2023
2e0754f
Merge pull request #352 from DarthAffe/IndicatorLedIds
DarthAffe Aug 28, 2023
c1a4fee
Added Razer Kraken Kitty V2 PID
DarthAffe Sep 4, 2023
012fdf6
Added PIDs for Blade 18, Naga V2 Pro (wired?) and Mouse Dock Pro
DarthAffe Sep 22, 2023
d454f94
Merge pull request #353 from DarthAffe/RazerPids
DarthAffe Sep 22, 2023
736d58c
Wooting - Add uwu support
diogotr7 Oct 17, 2023
69d320f
Ignore UwU non-RGB
diogotr7 Oct 17, 2023
7ad1e59
Added Missing LEDs
diogotr7 Oct 17, 2023
fcf86ff
Fix analog key coords
diogotr7 Oct 18, 2023
883d6cb
Added ToString to Scale
DarthAffe Oct 31, 2023
188de3c
Fixed an error when parsing custom layout data if the xml-element con…
DarthAffe Oct 31, 2023
be25279
Added extension to save layouts
DarthAffe Oct 31, 2023
fda89e7
Merge pull request #355 from DarthAffe/feature/wooting-uwu
DarthAffe Nov 1, 2023
99225f0
Merge pull request #357 from DarthAffe/LayoutFixes
DarthAffe Nov 1, 2023
08fbb0e
Fix custom LED data type not being determined correctly
RobertBeekman Nov 1, 2023
5592fd9
Merge pull request #358 from DarthAffe/bugfix/layout-saving
DarthAffe Nov 1, 2023
a0c9002
Added .NET 8 build-target
DarthAffe Nov 14, 2023
9575690
Merge pull request #359 from DarthAffe/Update/net8
DarthAffe Nov 14, 2023
8aaf602
Added GameController as Core device type; Updated Corsair SDK to 4.0.84
DarthAffe Dec 22, 2023
0444730
Merge pull request #361 from DarthAffe/SDK/Corsair
DarthAffe Dec 22, 2023
d85f155
Applied some C#12 stuff
DarthAffe Dec 22, 2023
cc2c7bc
Added tag-creation to ci workflow
DarthAffe Dec 22, 2023
2796acd
Merge pull request #363 from DarthAffe/Ci-Tags
DarthAffe Dec 22, 2023
aeab930
More code styling fixes
DarthAffe Dec 27, 2023
79f71ba
Merge pull request #362 from DarthAffe/Core/CodeStyling
DarthAffe Dec 31, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
31 changes: 21 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,19 @@ on:
jobs:
build:

runs-on: windows-2022
runs-on: windows-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
dotnet-version: |
8.0.x
7.0.x
6.0.x
- name: Git Semantic Version
id: versioning
uses: PaulHatch/semantic-version@v4.0.3
Expand All @@ -33,12 +36,6 @@ jobs:
run: dotnet build --no-restore --configuration Release /p:Version=${{ steps.versioning.outputs.version }}
- name: Test
run: dotnet test --no-build --verbosity normal --configuration Release
- name: Upload a Build Artifact NET5
uses: actions/upload-artifact@v2.2.4
with:
name: RGB.NET-NET5
path: bin/net5.0/RGB.NET.*.dll
if-no-files-found: error
- name: Upload a Build Artifact NET6
uses: actions/upload-artifact@v2.2.4
with:
Expand All @@ -51,6 +48,12 @@ jobs:
name: RGB.NET-NET7
path: bin/net7.0/RGB.NET.*.dll
if-no-files-found: error
- name: Upload a Build Artifact NET8
uses: actions/upload-artifact@v2.2.4
with:
name: RGB.NET-NET8
path: bin/net8.0/RGB.NET.*.dll
if-no-files-found: error
- name: Upload Nuget Build Artifact
uses: actions/upload-artifact@v2.2.4
with:
Expand All @@ -59,3 +62,11 @@ jobs:
if-no-files-found: error
- name: Nuget Push
run: dotnet nuget push **\*.nupkg --skip-duplicate --api-key ${{ secrets.NUGET_TOKEN }} --source https://api.nuget.org/v3/index.json
- name: Symbols Push
run: dotnet nuget push **\*.snupkg --skip-duplicate --api-key ${{ secrets.NUGET_TOKEN }} --source https://api.nuget.org/v3/index.json
- name: Create Tag
uses: mathieudutour/github-tag-action@v6.1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
custom_tag: ${{ steps.versioning.outputs.version }}
tag_prefix: v
11 changes: 7 additions & 4 deletions .github/workflows/pr_verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,17 @@ on:
jobs:
build:

runs-on: windows-2022
runs-on: windows-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
dotnet-version: |
8.0.x
7.0.x
6.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
Expand Down
25 changes: 14 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,19 @@ on:

jobs:
build:
runs-on: windows-2022
runs-on: windows-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
dotnet-version: |
8.0.x
7.0.x
6.0.x
- name: Git Semantic Version
id: versioning
uses: PaulHatch/semantic-version@v4.0.3
Expand All @@ -32,12 +35,6 @@ jobs:
run: dotnet build --no-restore --configuration Release /p:Version=${{ steps.versioning.outputs.version }}
- name: Test
run: dotnet test --no-build --verbosity normal --configuration Release
- name: Upload a Build Artifact NET5
uses: actions/upload-artifact@v2.2.4
with:
name: RGB.NET-NET5
path: bin/net5.0/RGB.NET.*.dll
if-no-files-found: error
- name: Upload a Build Artifact NET6
uses: actions/upload-artifact@v2.2.4
with:
Expand All @@ -50,6 +47,12 @@ jobs:
name: RGB.NET-NET7
path: bin/net7.0/RGB.NET.*.dll
if-no-files-found: error
- name: Upload a Build Artifact NET8
uses: actions/upload-artifact@v2.2.4
with:
name: RGB.NET-NET8
path: bin/net8.0/RGB.NET.*.dll
if-no-files-found: error
- name: Upload Nuget Build Artifact
uses: actions/upload-artifact@v2.2.4
with:
Expand All @@ -61,6 +64,6 @@ jobs:
with:
tag_name: ${{ steps.versioning.outputs.version_tag }}
generate_release_notes: true
files: bin/net7.0/RGB.NET.*.dll
files: bin/net8.0/RGB.NET.*.dll
- name: Nuget Push
run: dotnet nuget push **\*.nupkg --skip-duplicate --api-key ${{ secrets.NUGET_TOKEN }} --source https://api.nuget.org/v3/index.json
29 changes: 16 additions & 13 deletions RGB.NET.Core/Color/Behaviors/DefaultColorBehavior.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,44 +6,47 @@ namespace RGB.NET.Core;
/// <summary>
/// Represents the default-behavior for the work with colors.
/// </summary>
public class DefaultColorBehavior : IColorBehavior
public sealed class DefaultColorBehavior : IColorBehavior
{
#region Methods

/// <summary>
/// Converts the individual byte values of this <see cref="Color"/> to a human-readable string.
/// </summary>
/// <returns>A string that contains the individual byte values of this <see cref="Color"/>. For example "[A: 255, R: 255, G: 0, B: 0]".</returns>
public virtual string ToString(in Color color) => $"[A: {color.GetA()}, R: {color.GetR()}, G: {color.GetG()}, B: {color.GetB()}]";
public string ToString(in Color color) => $"[A: {color.GetA()}, R: {color.GetR()}, G: {color.GetG()}, B: {color.GetB()}]";

/// <summary>
/// Tests whether the specified object is a <see cref="Color" /> and is equivalent to this <see cref="Color" />.
/// </summary>
/// <param name="color">The color to test.</param>
/// <param name="obj">The object to test.</param>
/// <returns><c>true</c> if <paramref name="obj" /> is a <see cref="Color" /> equivalent to this <see cref="Color" />; otherwise, <c>false</c>.</returns>
public virtual bool Equals(in Color color, object? obj)
{
if (obj is not Color color2) return false;

return color.A.EqualsInTolerance(color2.A)
&& color.R.EqualsInTolerance(color2.R)
&& color.G.EqualsInTolerance(color2.G)
&& color.B.EqualsInTolerance(color2.B);
}
public bool Equals(in Color color, object? obj) => obj is Color color2 && Equals(color, color2);

/// <summary>
/// Tests whether the specified object is a <see cref="Color" /> and is equivalent to this <see cref="Color" />.
/// </summary>
/// <param name="color">The first color to test.</param>
/// <param name="color2">The second color to test.</param>
/// <returns><c>true</c> if <paramref name="color2" /> equivalent to this <see cref="Color" />; otherwise, <c>false</c>.</returns>
public bool Equals(in Color color, in Color color2) => color.A.EqualsInTolerance(color2.A)
&& color.R.EqualsInTolerance(color2.R)
&& color.G.EqualsInTolerance(color2.G)
&& color.B.EqualsInTolerance(color2.B);

/// <summary>
/// Returns a hash code for this <see cref="Color" />.
/// </summary>
/// <returns>An integer value that specifies the hash code for this <see cref="Color" />.</returns>
public virtual int GetHashCode(in Color color) => HashCode.Combine(color.A, color.R, color.G, color.B);
public int GetHashCode(in Color color) => HashCode.Combine(color.A, color.R, color.G, color.B);

/// <summary>
/// Blends a <see cref="Color"/> over this color.
/// </summary>
/// <param name="baseColor">The <see cref="Color"/> to to blend over.</param>
/// <param name="blendColor">The <see cref="Color"/> to blend.</param>
public virtual Color Blend(in Color baseColor, in Color blendColor)
public Color Blend(in Color baseColor, in Color blendColor)
{
if (blendColor.A.EqualsInTolerance(0)) return baseColor;

Expand Down
8 changes: 8 additions & 0 deletions RGB.NET.Core/Color/Behaviors/IColorBehavior.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ public interface IColorBehavior
/// <returns><c>true</c> if <paramref name="obj" /> is a <see cref="Color" /> equivalent to this <see cref="Color" />; otherwise, <c>false</c>.</returns>
bool Equals(in Color color, object? obj);

/// <summary>
/// Tests whether the specified object is a <see cref="Color" /> and is equivalent to this <see cref="Color" />.
/// </summary>
/// <param name="color">The first color to test.</param>
/// <param name="color2">The second color to test.</param>
/// <returns><c>true</c> if <paramref name="color2" /> equivalent to this <see cref="Color" />; otherwise, <c>false</c>.</returns>
bool Equals(in Color color, in Color color2);

/// <summary>
/// Returns a hash code for this <see cref="Color" />.
/// </summary>
Expand Down
9 changes: 8 additions & 1 deletion RGB.NET.Core/Color/Color.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace RGB.NET.Core;
/// Represents an ARGB (alpha, red, green, blue) color.
/// </summary>
[DebuggerDisplay("[A: {A}, R: {R}, G: {G}, B: {B}]")]
public readonly struct Color
public readonly struct Color : IEquatable<Color>
{
#region Constants

Expand Down Expand Up @@ -196,6 +196,13 @@ public Color(in Color color)
/// <returns><c>true</c> if <paramref name="obj" /> is a <see cref="Color" /> equivalent to this <see cref="Color" />; otherwise, <c>false</c>.</returns>
public override bool Equals(object? obj) => Behavior.Equals(this, obj);

/// <summary>
/// Tests whether the specified <see cref="Color" /> is equivalent to this <see cref="Color" />, as defined by the current <see cref="Behavior"/>.
/// </summary>
/// <param name="other">The color to test.</param>
/// <returns><c>true</c> if <paramref name="other" /> is equivalent to this <see cref="Color" />; otherwise, <c>false</c>.</returns>
public bool Equals(Color other) => Behavior.Equals(this, other);

/// <summary>
/// Returns a hash code for this <see cref="Color" />, as defined by the current <see cref="Behavior"/>.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion RGB.NET.Core/Decorators/AbstractDecorateable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public abstract class AbstractDecoratable<T> : AbstractBindable, IDecoratable<T>
{
#region Properties & Fields

private readonly List<T> _decorators = new();
private readonly List<T> _decorators = [];

/// <inheritdoc />
public IReadOnlyList<T> Decorators { get; }
Expand Down
6 changes: 3 additions & 3 deletions RGB.NET.Core/Decorators/AbstractDecorator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public int Order
/// <summary>
/// Gets a readonly-list of all <see cref="IDecoratable"/> this decorator is attached to.
/// </summary>
protected List<IDecoratable> DecoratedObjects { get; } = new();
protected List<IDecoratable> DecoratedObjects { get; } = [];

#endregion

Expand All @@ -46,14 +46,14 @@ public int Order
/// </summary>
protected virtual void Detach()
{
List<IDecoratable> decoratables = new(DecoratedObjects);
List<IDecoratable> decoratables = [..DecoratedObjects];
foreach (IDecoratable decoratable in decoratables)
{
IEnumerable<Type> types = decoratable.GetType().GetInterfaces().Where(t => t.IsGenericType
&& (t.Name == typeof(IDecoratable<>).Name)
&& t.GenericTypeArguments[0].IsInstanceOfType(this));
foreach (Type decoratableType in types)
decoratableType.GetMethod(nameof(IDecoratable<IDecorator>.RemoveDecorator))?.Invoke(decoratable, new object[] { this });
decoratableType.GetMethod(nameof(IDecoratable<IDecorator>.RemoveDecorator))?.Invoke(decoratable, [this]);
}
}

Expand Down
3 changes: 1 addition & 2 deletions RGB.NET.Core/Decorators/IDecoratable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ namespace RGB.NET.Core;
/// <summary>
/// Represents a basic decoratable.
/// </summary>
public interface IDecoratable : INotifyPropertyChanged
{ }
public interface IDecoratable : INotifyPropertyChanged;

/// <inheritdoc />
/// <summary>
Expand Down
3 changes: 1 addition & 2 deletions RGB.NET.Core/Decorators/ILedGroupDecorator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@
/// <summary>
/// Represents a basic decorator decorating a <see cref="T:RGB.NET.Core.ILedGroup" />.
/// </summary>
public interface ILedGroupDecorator : IDecorator
{ }
public interface ILedGroupDecorator : IDecorator;
Loading
Loading