Skip to content

Instantly share code, notes, and snippets.

View PieroCastillo's full-sized avatar
🎯
Focusing

Piero Castillo PieroCastillo

🎯
Focusing
  • Lima, Perú
View GitHub Profile
@PieroCastillo
PieroCastillo / Lighter or Darker a Color.cs
Created February 7, 2021 22:32 — forked from zihotki/Lighter or Darker a Color.cs
.net C# make a color lighter or darker
/// <summary>
/// Creates color with corrected brightness.
/// </summary>
/// <param name="color">Color to correct.</param>
/// <param name="correctionFactor">The brightness correction factor. Must be between -1 and 1.
/// Negative values produce darker colors.</param>
/// <returns>
/// Corrected <see cref="Color"/> structure.
/// </returns>
public static Color ChangeColorBrightness(Color color, float correctionFactor)
@PieroCastillo
PieroCastillo / SimpleSoundPlayer.cs
Created September 25, 2020 16:45 — forked from jtbrower/SimpleSoundPlayer.cs
Play a Sound Wave File in .Net, NetCore and Net5.0 without additional Media Libraries
namespace Gist
{
using System.Runtime.InteropServices;
//NOTICE : Applicable only to Windows and wav files
////////////////////////////////////////////////////////////////////////////////////////////////////
/// <summary>
/// A class that uses PInvoke to play a wave file in DotNet Core, .Net and Net5.0. This function
/// will not work on non Windows platforms, but does work on alternative UI frameworks such as