Skip to content

Commit 4e575e8

Browse files
authored
Merge pull request #418 from DarthAffe/Development
v3
2 parents 1b9531a + f8e4cc6 commit 4e575e8

File tree

135 files changed

+711
-396
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

135 files changed

+711
-396
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,26 +24,19 @@ jobs:
2424
uses: actions/setup-dotnet@v4
2525
with:
2626
dotnet-version: |
27+
9.0.x
2728
8.0.x
28-
7.0.x
29-
6.0.x
3029
- name: Restore dependencies
3130
run: dotnet restore
3231
- name: Build
3332
run: dotnet build --no-restore --configuration Release /p:Version=${{ github.event.inputs.version }}-prerelease.${{ github.event.inputs.increment }}
3433
- name: Test
3534
run: dotnet test --no-build --verbosity normal --configuration Release
36-
- name: Upload a Build Artifact NET6
35+
- name: Upload a Build Artifact NET9
3736
uses: actions/upload-artifact@v4.3.1
3837
with:
39-
name: RGB.NET-NET6
40-
path: bin/net6.0/RGB.NET.*.dll
41-
if-no-files-found: error
42-
- name: Upload a Build Artifact NET7
43-
uses: actions/upload-artifact@v4.3.1
44-
with:
45-
name: RGB.NET-NET7
46-
path: bin/net7.0/RGB.NET.*.dll
38+
name: RGB.NET-NET9
39+
path: bin/net9.0/RGB.NET.*.dll
4740
if-no-files-found: error
4841
- name: Upload a Build Artifact NET8
4942
uses: actions/upload-artifact@v4.3.1

.github/workflows/pr_verify.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@ jobs:
1515
uses: actions/setup-dotnet@v4
1616
with:
1717
dotnet-version: |
18+
9.0.x
1819
8.0.x
19-
7.0.x
20-
6.0.x
2120
- name: Restore dependencies
2221
run: dotnet restore
2322
- name: Build

.github/workflows/release.yml

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,26 +20,19 @@ jobs:
2020
uses: actions/setup-dotnet@v4
2121
with:
2222
dotnet-version: |
23+
9.0.x
2324
8.0.x
24-
7.0.x
25-
6.0.x
2625
- name: Restore dependencies
2726
run: dotnet restore
2827
- name: Build
2928
run: dotnet build --no-restore --configuration Release /p:Version=${{ github.event.inputs.version }}
3029
- name: Test
3130
run: dotnet test --no-build --verbosity normal --configuration Release
32-
- name: Upload a Build Artifact NET6
31+
- name: Upload a Build Artifact NET9
3332
uses: actions/upload-artifact@v4.3.1
3433
with:
35-
name: RGB.NET-NET6
36-
path: bin/net6.0/RGB.NET.*.dll
37-
if-no-files-found: error
38-
- name: Upload a Build Artifact NET7
39-
uses: actions/upload-artifact@v4.3.1
40-
with:
41-
name: RGB.NET-NET7
42-
path: bin/net7.0/RGB.NET.*.dll
34+
name: RGB.NET-NET9
35+
path: bin/net9.0/RGB.NET.*.dll
4336
if-no-files-found: error
4437
- name: Upload a Build Artifact NET8
4538
uses: actions/upload-artifact@v4.3.1
@@ -58,6 +51,6 @@ jobs:
5851
with:
5952
tag_name: v${{ github.event.inputs.version }}
6053
generate_release_notes: true
61-
files: bin/net8.0/RGB.NET.*.dll
54+
files: bin/net9.0/RGB.NET.*.dll
6255
- name: Nuget Push
6356
run: dotnet nuget push **\*.nupkg --skip-duplicate --api-key ${{ secrets.NUGET_TOKEN }} --source https://api.nuget.org/v3/index.json

RGB.NET.Core/Color/Behaviors/DefaultColorBehavior.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,23 @@ public sealed class DefaultColorBehavior : IColorBehavior
1414
/// Converts the individual byte values of this <see cref="Color"/> to a human-readable string.
1515
/// </summary>
1616
/// <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>
17-
public string ToString(in Color color) => $"[A: {color.GetA()}, R: {color.GetR()}, G: {color.GetG()}, B: {color.GetB()}]";
17+
public string ToString(Color color) => $"[A: {color.GetA()}, R: {color.GetR()}, G: {color.GetG()}, B: {color.GetB()}]";
1818

1919
/// <summary>
2020
/// Tests whether the specified object is a <see cref="Color" /> and is equivalent to this <see cref="Color" />.
2121
/// </summary>
2222
/// <param name="color">The color to test.</param>
2323
/// <param name="obj">The object to test.</param>
2424
/// <returns><c>true</c> if <paramref name="obj" /> is a <see cref="Color" /> equivalent to this <see cref="Color" />; otherwise, <c>false</c>.</returns>
25-
public bool Equals(in Color color, object? obj) => obj is Color color2 && Equals(color, color2);
25+
public bool Equals(Color color, object? obj) => obj is Color color2 && Equals(color, color2);
2626

2727
/// <summary>
2828
/// Tests whether the specified object is a <see cref="Color" /> and is equivalent to this <see cref="Color" />.
2929
/// </summary>
3030
/// <param name="color">The first color to test.</param>
3131
/// <param name="color2">The second color to test.</param>
3232
/// <returns><c>true</c> if <paramref name="color2" /> equivalent to this <see cref="Color" />; otherwise, <c>false</c>.</returns>
33-
public bool Equals(in Color color, in Color color2) => color.A.EqualsInTolerance(color2.A)
33+
public bool Equals(Color color, Color color2) => color.A.EqualsInTolerance(color2.A)
3434
&& color.R.EqualsInTolerance(color2.R)
3535
&& color.G.EqualsInTolerance(color2.G)
3636
&& color.B.EqualsInTolerance(color2.B);
@@ -39,14 +39,14 @@ public bool Equals(in Color color, in Color color2) => color.A.EqualsInTolerance
3939
/// Returns a hash code for this <see cref="Color" />.
4040
/// </summary>
4141
/// <returns>An integer value that specifies the hash code for this <see cref="Color" />.</returns>
42-
public int GetHashCode(in Color color) => HashCode.Combine(color.A, color.R, color.G, color.B);
42+
public int GetHashCode(Color color) => HashCode.Combine(color.A, color.R, color.G, color.B);
4343

4444
/// <summary>
4545
/// Blends a <see cref="Color"/> over this color.
4646
/// </summary>
4747
/// <param name="baseColor">The <see cref="Color"/> to to blend over.</param>
4848
/// <param name="blendColor">The <see cref="Color"/> to blend.</param>
49-
public Color Blend(in Color baseColor, in Color blendColor)
49+
public Color Blend(Color baseColor, Color blendColor)
5050
{
5151
if (blendColor.A.EqualsInTolerance(0)) return baseColor;
5252

RGB.NET.Core/Color/Behaviors/IColorBehavior.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,34 +10,34 @@ public interface IColorBehavior
1010
/// </summary>
1111
/// <param name="color">The color to convert.</param>
1212
/// <returns>The string representation of the specified color.</returns>
13-
string ToString(in Color color);
13+
string ToString(Color color);
1414

1515
/// <summary>
1616
/// Tests whether the specified object is a <see cref="Color" /> and is equivalent to this <see cref="Color" />.
1717
/// </summary>
1818
/// <param name="color">The color to test.</param>
1919
/// <param name="obj">The object to test.</param>
2020
/// <returns><c>true</c> if <paramref name="obj" /> is a <see cref="Color" /> equivalent to this <see cref="Color" />; otherwise, <c>false</c>.</returns>
21-
bool Equals(in Color color, object? obj);
21+
bool Equals(Color color, object? obj);
2222

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

3131
/// <summary>
3232
/// Returns a hash code for this <see cref="Color" />.
3333
/// </summary>
3434
/// <returns>An integer value that specifies the hash code for this <see cref="Color" />.</returns>
35-
int GetHashCode(in Color color);
35+
int GetHashCode(Color color);
3636

3737
/// <summary>
3838
/// Blends a <see cref="Color"/> over this color.
3939
/// </summary>
4040
/// <param name="baseColor">The <see cref="Color"/> to to blend over.</param>
4141
/// <param name="blendColor">The <see cref="Color"/> to blend.</param>
42-
Color Blend(in Color baseColor, in Color blendColor);
42+
Color Blend(Color baseColor, Color blendColor);
4343
}

RGB.NET.Core/Color/Color.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ public Color(float a, float r, float g, float b)
175175
/// Initializes a new instance of the <see cref="T:RGB.NET.Core.Color" /> struct by cloning a existing <see cref="T:RGB.NET.Core.Color" />.
176176
/// </summary>
177177
/// <param name="color">The <see cref="T:RGB.NET.Core.Color" /> the values are copied from.</param>
178-
public Color(in Color color)
178+
public Color(Color color)
179179
: this(color.A, color.R, color.G, color.B)
180180
{ }
181181

@@ -214,7 +214,7 @@ public Color(in Color color)
214214
/// Blends a <see cref="Color"/> over this color, as defined by the current <see cref="Behavior"/>.
215215
/// </summary>
216216
/// <param name="color">The <see cref="Color"/> to blend.</param>
217-
public Color Blend(in Color color) => Behavior.Blend(this, color);
217+
public Color Blend(Color color) => Behavior.Blend(this, color);
218218

219219
#endregion
220220

@@ -226,23 +226,23 @@ public Color(in Color color)
226226
/// <param name="color1">The base color.</param>
227227
/// <param name="color2">The color to blend.</param>
228228
/// <returns>The blended color.</returns>
229-
public static Color operator +(in Color color1, in Color color2) => color1.Blend(color2);
229+
public static Color operator +(Color color1, Color color2) => color1.Blend(color2);
230230

231231
/// <summary>
232232
/// Returns a value that indicates whether two specified <see cref="Color" /> are equal.
233233
/// </summary>
234234
/// <param name="color1">The first <see cref="Color" /> to compare.</param>
235235
/// <param name="color2">The second <see cref="Color" /> to compare.</param>
236236
/// <returns><c>true</c> if <paramref name="color1" /> and <paramref name="color2" /> are equal; otherwise, <c>false</c>.</returns>
237-
public static bool operator ==(in Color color1, in Color color2) => color1.Equals(color2);
237+
public static bool operator ==(Color color1, Color color2) => color1.Equals(color2);
238238

239239
/// <summary>
240240
/// Returns a value that indicates whether two specified <see cref="Color" /> are equal.
241241
/// </summary>
242242
/// <param name="color1">The first <see cref="Color" /> to compare.</param>
243243
/// <param name="color2">The second <see cref="Color" /> to compare.</param>
244244
/// <returns><c>true</c> if <paramref name="color1" /> and <paramref name="color2" /> are not equal; otherwise, <c>false</c>.</returns>
245-
public static bool operator !=(in Color color1, in Color color2) => !(color1 == color2);
245+
public static bool operator !=(Color color1, Color color2) => !(color1 == color2);
246246

247247
/// <summary>
248248
/// Converts a <see cref="ValueTuple"/> of ARGB-components to a <see cref="Color"/>.

RGB.NET.Core/Color/HSVColor.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,21 @@ public static class HSVColor
1616
/// </summary>
1717
/// <param name="color">The color to get the value from.</param>
1818
/// <returns>The hue component value of the color.</returns>
19-
public static float GetHue(this in Color color) => color.GetHSV().hue;
19+
public static float GetHue(this Color color) => color.GetHSV().hue;
2020

2121
/// <summary>
2222
/// Gets the saturation component value (HSV-color space) of this <see cref="Color"/> in the range [0..1].
2323
/// </summary>
2424
/// <param name="color">The color to get the value from.</param>
2525
/// <returns>The saturation component value of the color.</returns>
26-
public static float GetSaturation(this in Color color) => color.GetHSV().saturation;
26+
public static float GetSaturation(this Color color) => color.GetHSV().saturation;
2727

2828
/// <summary>
2929
/// Gets the value component value (HSV-color space) of this <see cref="Color"/> in the range [0..1].
3030
/// </summary>
3131
/// <param name="color">The color to get the value from.</param>
3232
/// <returns>The value component value of the color.</returns>
33-
public static float GetValue(this in Color color) => color.GetHSV().value;
33+
public static float GetValue(this Color color) => color.GetHSV().value;
3434

3535
/// <summary>
3636
/// Gets the hue, saturation and value component values (HSV-color space) of this <see cref="Color"/>.
@@ -40,7 +40,7 @@ public static class HSVColor
4040
/// </summary>
4141
/// <param name="color">The color to get the value from.</param>
4242
/// <returns>A tuple containing the hue, saturation and value component value of the color.</returns>
43-
public static (float hue, float saturation, float value) GetHSV(this in Color color)
43+
public static (float hue, float saturation, float value) GetHSV(this Color color)
4444
=> CaclulateHSVFromRGB(color.R, color.G, color.B);
4545

4646
#endregion
@@ -55,7 +55,7 @@ public static (float hue, float saturation, float value) GetHSV(this in Color co
5555
/// <param name="saturation">The saturation value to add.</param>
5656
/// <param name="value">The value value to add.</param>
5757
/// <returns>The new color after the modification.</returns>
58-
public static Color AddHSV(this in Color color, float hue = 0, float saturation = 0, float value = 0)
58+
public static Color AddHSV(this Color color, float hue = 0, float saturation = 0, float value = 0)
5959
{
6060
(float cHue, float cSaturation, float cValue) = color.GetHSV();
6161
return Create(color.A, cHue + hue, cSaturation + saturation, cValue + value);
@@ -69,7 +69,7 @@ public static Color AddHSV(this in Color color, float hue = 0, float saturation
6969
/// <param name="saturation">The saturation value to subtract.</param>
7070
/// <param name="value">The value value to subtract.</param>
7171
/// <returns>The new color after the modification.</returns>
72-
public static Color SubtractHSV(this in Color color, float hue = 0, float saturation = 0, float value = 0)
72+
public static Color SubtractHSV(this Color color, float hue = 0, float saturation = 0, float value = 0)
7373
{
7474
(float cHue, float cSaturation, float cValue) = color.GetHSV();
7575
return Create(color.A, cHue - hue, cSaturation - saturation, cValue - value);
@@ -83,7 +83,7 @@ public static Color SubtractHSV(this in Color color, float hue = 0, float satura
8383
/// <param name="saturation">The saturation value to multiply.</param>
8484
/// <param name="value">The value value to multiply.</param>
8585
/// <returns>The new color after the modification.</returns>
86-
public static Color MultiplyHSV(this in Color color, float hue = 1, float saturation = 1, float value = 1)
86+
public static Color MultiplyHSV(this Color color, float hue = 1, float saturation = 1, float value = 1)
8787
{
8888
(float cHue, float cSaturation, float cValue) = color.GetHSV();
8989
return Create(color.A, cHue * hue, cSaturation * saturation, cValue * value);
@@ -97,7 +97,7 @@ public static Color MultiplyHSV(this in Color color, float hue = 1, float satura
9797
/// <param name="saturation">The saturation value to divide.</param>
9898
/// <param name="value">The value value to divide.</param>
9999
/// <returns>The new color after the modification.</returns>
100-
public static Color DivideHSV(this in Color color, float hue = 1, float saturation = 1, float value = 1)
100+
public static Color DivideHSV(this Color color, float hue = 1, float saturation = 1, float value = 1)
101101
{
102102
(float cHue, float cSaturation, float cValue) = color.GetHSV();
103103
return Create(color.A, cHue / hue, cSaturation / saturation, cValue / value);
@@ -111,7 +111,7 @@ public static Color DivideHSV(this in Color color, float hue = 1, float saturati
111111
/// <param name="saturation">The saturation value to set.</param>
112112
/// <param name="value">The value value to set.</param>
113113
/// <returns>The new color after the modification.</returns>
114-
public static Color SetHSV(this in Color color, float? hue = null, float? saturation = null, float? value = null)
114+
public static Color SetHSV(this Color color, float? hue = null, float? saturation = null, float? value = null)
115115
{
116116
(float cHue, float cSaturation, float cValue) = color.GetHSV();
117117
return Create(color.A, hue ?? cHue, saturation ?? cSaturation, value ?? cValue);

0 commit comments

Comments
 (0)