mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2026-11-11 13:06:24 +00:00
Refactored color
This commit is contained in:
1 parent
e70c1c6bb0
commit
c1e2af6fbb
16 files changed
+929
-1361
No files matched your search
@@ -73,10 +73,8 @@ namespace RGB.NET.Brushes.Gradients
|
||||
public Color GetColor(double offset)
|
||||
{
|
||||
double range = EndHue - StartHue;
|
||||
double hue = (StartHue + (range * offset)) % 360f;
|
||||
if (hue < 0)
|
||||
hue += 360;
|
||||
return Color.FromHSV(hue, 1, 1);
|
||||
double hue = StartHue + (range * offset);
|
||||
return HSVColor.Create(hue, 1, 1);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@@ -87,7 +85,7 @@ namespace RGB.NET.Brushes.Gradients
|
||||
|
||||
StartHue += offset;
|
||||
EndHue += offset;
|
||||
|
||||
|
||||
while ((StartHue > 360) && (EndHue > 360))
|
||||
{
|
||||
StartHue -= 360;
|
||||
|
||||
Reference in new issue
Block a user