Skip to content

Commit

Permalink
* release
Browse files Browse the repository at this point in the history
  • Loading branch information
Yannayar committed Aug 14, 2023
1 parent 4f1b708 commit 5f99c05
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 37 deletions.
70 changes: 33 additions & 37 deletions greys/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,25 @@
using greys;
// Copyright (c) 2023 A.B
// yanna92yar@gmail.com

// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:

// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.

// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

using greys;
using Pastel;
using System.Drawing;
using System.Runtime.InteropServices;
Expand All @@ -24,7 +45,10 @@ static void Main(string[] args)
"Sepia",
"NegativeSepia",
"HueShift180",
"NegativeHueShift180"
"NegativeHueShift180",
"NegativeHueShift180Variation1",
"NegativeHueShift180Variation2",
"NegativeHueShift180Variation3"
};

float[] identity = BuiltinMatrices.Identity.Cast<float>().ToArray();
Expand All @@ -37,6 +61,9 @@ static void Main(string[] args)
float[] NegativeSepia = BuiltinMatrices.NegativeSepia.Cast<float>().ToArray();
float[] HueShift180 = BuiltinMatrices.HueShift180.Cast<float>().ToArray();
float[] NegativeHueShift180 = BuiltinMatrices.NegativeHueShift180.Cast<float>().ToArray();
float[] NegativeHueShift180Variation1 = BuiltinMatrices.NegativeHueShift180Variation1.Cast<float>().ToArray();
float[] NegativeHueShift180Variation2 = BuiltinMatrices.NegativeHueShift180Variation2.Cast<float>().ToArray();
float[] NegativeHueShift180Variation3 = BuiltinMatrices.NegativeHueShift180Variation3.Cast<float>().ToArray();

List<float[]> colorFilters = new List<float[]> {
identity,
Expand All @@ -48,7 +75,10 @@ static void Main(string[] args)
Sepia,
NegativeSepia,
HueShift180,
NegativeHueShift180
NegativeHueShift180,
NegativeHueShift180Variation1,
NegativeHueShift180Variation2,
NegativeHueShift180Variation3
};
var magEffectInvert = new MAGCOLOREFFECT
{
Expand Down Expand Up @@ -125,40 +155,6 @@ static void Main(string[] args)

private static void welcomeUser()
{
// Get an array with the values of ConsoleColor enumeration members.
ConsoleColor[] colors = (ConsoleColor[])ConsoleColor.GetValues(typeof(ConsoleColor));
// Save the current background and foreground colors.
ConsoleColor currentBackground = Console.BackgroundColor;
ConsoleColor currentForeground = Console.ForegroundColor;

// Display all foreground colors except the one that matches the background.
Console.WriteLine("All the foreground colors except {0}, the background color:",
currentBackground);
foreach (var color in colors)
{
if (color == currentBackground) continue;

Console.ForegroundColor = color;
Console.WriteLine(" The foreground color is {0}.", color);
}
Console.WriteLine();
// Restore the foreground color.
Console.ForegroundColor = currentForeground;

// Display each background color except the one that matches the current foreground color.
Console.WriteLine("All the background colors except {0}, the foreground color:",
currentForeground);
foreach (var color in colors)
{
if (color == currentForeground) continue;

Console.BackgroundColor = color;
Console.WriteLine(" The background color is {0}.", color);
}

// Restore the original console colors.
Console.ResetColor();
Console.WriteLine("\nOriginal colors restored...");
Console.Write(" Red ".Pastel(Color.Black).PastelBg("FF0000"));
Console.Write(" Green ".Pastel(Color.Black).PastelBg("00FF00"));
Console.Write(" Blue ".Pastel(Color.Black).PastelBg("0000FF"));
Expand Down
13 changes: 13 additions & 0 deletions greys/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Greys

Make photos and colors easier to see by applying a color filter to your screen.

The app should work on Windows 8 up to Windows 11 with no problems. Although it has only been tested on Windows 10 and 11.

## Usage

Just lunch the binary and use arrows to navigate through color filters; Press "Enter" to apply and choose "Neutral" filter to go back to normal (or just close the app).

## License

MIT

0 comments on commit 5f99c05

Please sign in to comment.