Skip to content

Commit

Permalink
Merge pull request #355 from Leo-Corporation/vNext
Browse files Browse the repository at this point in the history
Version 5.8.0.2312
  • Loading branch information
lpeyr authored Dec 10, 2023
2 parents 9218e2b + a804895 commit 7d5888b
Show file tree
Hide file tree
Showing 56 changed files with 1,311 additions and 1,206 deletions.
4 changes: 2 additions & 2 deletions ColorPicker.Setup/Setup.iss
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "ColorPicker Max"
#define MyAppVersion "5.7.1.2311"
#define MyAppFullVersion "5.7.1.2311"
#define MyAppVersion "5.8.0.2312"
#define MyAppFullVersion "5.8.0.2312"
#define MyAppPublisher "Léo Corporation"
#define MyAppURL "https://leocorporation.dev/"
#define MyAppExeName "ColorPicker.exe"
Expand Down
94 changes: 47 additions & 47 deletions ColorPicker/App.xaml

Large diffs are not rendered by default.

13 changes: 6 additions & 7 deletions ColorPicker/Classes/Bookmarks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
using PeyrSharp.Core.Converters;
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
Expand All @@ -41,19 +40,19 @@ public class BookmarkText : IEquatable<BookmarkText>
public string FontFamily { get; init; }
public string ForegroundColor { get; init; }
public string BackgroundColor { get; init; }
public BookmarkText()
{
public BookmarkText()
{
FontFamily = "Arial"; // Fallback values
ForegroundColor = "#000000";
BackgroundColor = "#FFFFFF";
}
}

public BookmarkText(string font, string fore, string back)
{
public BookmarkText(string font, string fore, string back)
{
FontFamily = font;
ForegroundColor = fore;
BackgroundColor = back;
}
}

public bool Equals(BookmarkText? obj)
{
Expand Down
5 changes: 0 additions & 5 deletions ColorPicker/Classes/DEC.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE

using ColorHelper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace ColorPicker.Classes;
public class DEC
Expand Down
24 changes: 17 additions & 7 deletions ColorPicker/Classes/Global.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
using System.Linq;
using System.Threading;
using System.Windows;
using System.Windows.Markup.Localizer;
using System.Windows.Media;

namespace ColorPicker.Classes;
Expand Down Expand Up @@ -82,12 +81,14 @@ public static class Global
}
};

internal static Action RefreshButton { get; set; }

internal static string SynethiaPath => $@"{FileSys.AppDataPath}\Léo Corporation\ColorPicker Max\SynethiaConfig.json";
internal static string BookmarksPath => $@"{FileSys.AppDataPath}\Léo Corporation\ColorPicker Max\Bookmarks.xml";
internal static string SettingsPath => $@"{FileSys.AppDataPath}\Léo Corporation\ColorPicker Max\Settings.xml";
public static string LastVersionLink => "https://raw.githubusercontent.com/Leo-Corporation/LeoCorp-Docs/master/Liens/Update%20System/ColorPicker/5.0/Version.txt";

public static string Version => "5.7.1.2311";
public static string Version => "5.8.0.2312";

public static string HiSentence
{
Expand Down Expand Up @@ -161,7 +162,7 @@ public static System.Drawing.Color GenerateRandomColorDrawing()
int r = random.Next(0, 255); int g = random.Next(0, 255); int b = random.Next(0, 255); // Generate random values
return System.Drawing.Color.FromArgb(r, g, b);
}
public static Color GetColorFromResource(string resourceName) => (Color)System.Windows.Media.ColorConverter.ConvertFromString(Application.Current.Resources[resourceName].ToString());
public static SolidColorBrush GetColorFromResource(string resource) => (SolidColorBrush)Application.Current.Resources[resource];

public static double GetLuminance(int r, int g, int b)
{
Expand Down Expand Up @@ -253,7 +254,7 @@ public static AppPages PageInfoToAppPages(PageInfo pageInfo)
/// <summary>
/// Changes the application's theme.
/// </summary>
public static void ChangeTheme()
public static void ChangeTheme(bool reload = false)
{
App.Current.Resources.MergedDictionaries.Clear();
ResourceDictionary resourceDictionary = new(); // Create a resource dictionary
Expand All @@ -274,6 +275,15 @@ public static void ChangeTheme()
}

App.Current.Resources.MergedDictionaries.Add(resourceDictionary); // Add the dictionary

if (!reload) return;
AiGenPage.CheckButton(AiGenPage.CheckedButton);
BookmarksPage.CheckButton(BookmarksPage.CheckedButton);
ConverterPage.CheckButton(ConverterPage.SelectedColorBtn);
ChromaticWheelPage.CheckButton(ChromaticWheelPage.CheckedButton);
HarmoniesPage.CheckButton(HarmoniesPage.SelectedColorBtn);
PalettePage.CheckButton(PalettePage.SelectedColorBtn);
RefreshButton();
}

public static bool IsSystemThemeDark()
Expand Down Expand Up @@ -468,9 +478,9 @@ public static Color[] GenerateTriadicColors(Color baseColor)

public static void ColorToHSL(Color color, out float h, out float s, out float l)
{
float r = (float)color.R / 255f;
float g = (float)color.G / 255f;
float b = (float)color.B / 255f;
float r = color.R / 255f;
float g = color.G / 255f;
float b = color.B / 255f;

float max = Math.Max(r, Math.Max(g, b));
float min = Math.Min(r, Math.Min(g, b));
Expand Down
8 changes: 4 additions & 4 deletions ColorPicker/ColorPicker.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<Title>ColorPicker</Title>
<Description>Maximize your creativity.</Description>
<RepositoryUrl>https://github.com/Leo-Corporation/ColorPicker</RepositoryUrl>
<Version>5.7.1.2311</Version>
<Version>5.8.0.2312</Version>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageIcon>logo.png</PackageIcon>
<ApplicationIcon>CPM.ico</ApplicationIcon>
Expand Down Expand Up @@ -48,11 +48,11 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Betalgo.OpenAI" Version="7.3.1" />
<PackageReference Include="Betalgo.OpenAI" Version="7.4.1" />
<PackageReference Include="ColorHelper" Version="1.8.1" />
<PackageReference Include="MouseKeyHook" Version="5.7.1" />
<PackageReference Include="PeyrSharp.Env" Version="1.10.0.2310" />
<PackageReference Include="PeyrSharp.Core" Version="1.10.0.2310" />
<PackageReference Include="PeyrSharp.Core" Version="2.0.0.2311" />
<PackageReference Include="PeyrSharp.Env" Version="2.0.0.2311" />
<PackageReference Include="Synethia" Version="1.1.1.2302" />
</ItemGroup>

Expand Down
24 changes: 12 additions & 12 deletions ColorPicker/Enums/ColorTypes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE

namespace ColorPicker.Enums
{
public enum ColorTypes
{
RGB,
HEX,
HSV,
HSL,
CMYK,
XYZ,
YIQ,
YUV,
DEC
}
public enum ColorTypes
{
RGB,
HEX,
HSV,
HSL,
CMYK,
XYZ,
YIQ,
YUV,
DEC
}
}
Loading

0 comments on commit 7d5888b

Please sign in to comment.