Skip to content

Commit

Permalink
Icon refresh - working on PnP file processors
Browse files Browse the repository at this point in the history
  • Loading branch information
StijnKuipers committed Oct 8, 2020
1 parent e202e22 commit 525cdb1
Show file tree
Hide file tree
Showing 52 changed files with 1,318 additions and 453 deletions.
Binary file modified AntennaBuilder/favicon.ico
Binary file not shown.
Binary file modified AutoPanelBuilder/favicon.ico
Binary file not shown.
Binary file modified CaseBuilder/favicon.ico
Binary file not shown.
Binary file modified DirtyPCBs/Base64Extractor/favicon.ico
Binary file not shown.
Binary file modified DirtyPCBs/DirtyLocaleTest/favicon.ico
Binary file not shown.
Binary file modified DirtyPCBs/DirtyPCB_BoardRender/favicon.ico
Binary file not shown.
Binary file modified DirtyPCBs/DirtyPCB_BoardStats/favicon.ico
Binary file not shown.
Binary file modified DirtyPCBs/DirtyPCB_DXFStats/favicon.ico
Binary file not shown.
Binary file modified DirtyPCBs/SickOfBeige/favicon.ico
Binary file not shown.
Binary file modified FitBitmapToOutlineAndMerge/favicon.ico
Binary file not shown.
Binary file modified GerberAnalyse/favicon.ico
Binary file not shown.
Binary file modified GerberClipper/favicon.ico
Binary file not shown.
Binary file modified GerberCombiner/favicon.ico
Binary file not shown.
252 changes: 207 additions & 45 deletions GerberLibrary/Core/BillOfMaterials.cs

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions GerberLibrary/Core/GerberPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ public override void AddString(string text, float progress = -1)
}




public class GerberPanel
{
public GerberLayoutSet TheSet;
Expand Down
50 changes: 50 additions & 0 deletions GerberLibrary/Core/Helpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,56 @@ private float Length()

public static class Helpers
{


public static Color RefractionNormalledMaxBrightnessAndSat(float Inp)
{
float adjusted = (Inp * 0.25f) + 0.3f;
var C = Refraction(adjusted);

double h, s, v;
ColorToHSV(C, out h, out s, out v);
s = 1;
v = 1;
return ColorFromHSV(h, s, v);
}

public static void ColorToHSV(Color color, out double hue, out double saturation, out double value)
{
int max = Math.Max(color.R, Math.Max(color.G, color.B));
int min = Math.Min(color.R, Math.Min(color.G, color.B));

hue = color.GetHue();
saturation = (max == 0) ? 0 : 1d - (1d * min / max);
value = max / 255d;
}


public static Color ColorFromHSV(double hue, double saturation, double value)
{
int hi = Convert.ToInt32(Math.Floor(hue / 60)) % 6;
double f = hue / 60 - Math.Floor(hue / 60);

value = value * 255;
int v = Convert.ToInt32(value);
int p = Convert.ToInt32(value * (1 - saturation));
int q = Convert.ToInt32(value * (1 - f * saturation));
int t = Convert.ToInt32(value * (1 - (1 - f) * saturation));

if (hi == 0)
return Color.FromArgb(255, v, t, p);
else if (hi == 1)
return Color.FromArgb(255, q, v, p);
else if (hi == 2)
return Color.FromArgb(255, p, v, t);
else if (hi == 3)
return Color.FromArgb(255, p, q, v);
else if (hi == 4)
return Color.FromArgb(255, t, p, v);
else
return Color.FromArgb(255, v, p, q);
}

public static PathDefWithClosed Sanitize(PathDefWithClosed inp)
{
PathDefWithClosed R = new PathDefWithClosed();
Expand Down
Binary file modified GerberLibrary/favicon.ico
Binary file not shown.
Binary file modified GerberMover/favicon.ico
Binary file not shown.
Binary file modified GerberPanelizer/favicon.ico
Binary file not shown.
Binary file modified GerberProjects/OpampCalculator/favicon.ico
Binary file not shown.
Binary file modified GerberSanitize/favicon.ico
Binary file not shown.
Binary file modified GerberSplitter/favicon.ico
Binary file not shown.
Binary file modified GerberToImage/favicon.ico
Binary file not shown.
Binary file modified GerberToOutline/favicon.ico
Binary file not shown.
Binary file modified GerberViewer/favicon.ico
Binary file not shown.
Binary file modified ImageToGerber/favicon.ico
Binary file not shown.
209 changes: 177 additions & 32 deletions PnP_Processor/Actions.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 525cdb1

Please sign in to comment.