Skip to content
This repository has been archived by the owner on Oct 11, 2023. It is now read-only.

Commit

Permalink
[2022/11/02]
Browse files Browse the repository at this point in the history
* Fixed a bug in the AciColor.FromHsl method, under certain circumstances the RGB values where not calculated correctly.
  • Loading branch information
haplokuon committed Nov 2, 2022
1 parent 922fb00 commit c25b08e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
3 changes: 1 addition & 2 deletions TestDxfDocument/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ namespace TestDxfDocument
/// </summary>
public class Program
{

public static void Main()
public static void Main()
{
DxfDocument doc = Test(@"sample.dxf");

Expand Down
3 changes: 3 additions & 0 deletions doc/Changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## Change history

### [2022/11/02]
* Fixed a bug in the AciColor.FromHsl method, under certain circumstances the RGB values where not calculated correctly.

### [2022/11/01]
* Workaround for bad DXF files that contain polyface with invalid geometry, they will be removed.
* Workaround for bad DXF files that contains entities without handles. This may derive in unexpected side effects.
Expand Down
7 changes: 6 additions & 1 deletion netDxf/AciColor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ public static AciColor FromHsl(double hue, double saturation, double lightness)
double mid2 = v - vsf;
switch (sextant)
{
case 0 | 6:
case 0:
red = v;
green = mid1;
blue = m;
Expand Down Expand Up @@ -700,6 +700,11 @@ public static AciColor FromHsl(double hue, double saturation, double lightness)
green = m;
blue = mid2;
break;
case 6:
red = v;
green = mid1;
blue = m;
break;
}
}
return new AciColor(red, green, blue);
Expand Down

0 comments on commit c25b08e

Please sign in to comment.