Skip to content
This repository was archived by the owner on Sep 21, 2023. It is now read-only.

Commit 2ba3fb3

Browse files
author
Alexis Huvier
committed
feat(color): Add Darker and Lighter Function
1 parent 2941065 commit 2ba3fb3

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

SharpEngine/Utils/Color.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,20 @@ public Color(int r, int g, int b, int a)
7878
A = a;
7979
}
8080

81+
/// <summary>
82+
/// Return Darker Color
83+
/// </summary>
84+
/// <param name="force">Force of Darker Color</param>
85+
/// <returns>Darker Color</returns>
86+
public Color Darker(int force = 1) => new(_r - 10 * force, _g - 10 * force, _b - 10 * force, _a);
87+
88+
/// <summary>
89+
/// Return Lighter Color
90+
/// </summary>
91+
/// <param name="force">Force of Lighter Color</param>
92+
/// <returns>Lighter Color</returns>
93+
public Color Lighter(int force = 1) => new(_r + 10 * force, _g + 10 * force, _b + 10 * force, _a);
94+
8195
/// <summary>
8296
/// Transition Color to target color
8397
/// </summary>

0 commit comments

Comments
 (0)