public void SetRGB(int red, int green, int blue) { NCLR.HSLColor hslColor = (NCLR.HSLColor)Color.FromArgb(red, green, blue); this.hue = hslColor.hue; this.saturation = hslColor.saturation; this.luminosity = hslColor.luminosity; }
private void trackBar6_Scroll(object sender, EventArgs e) { float num1 = (float)this.trackBar4.Value / 240f; float num2 = (float)this.trackBar5.Value / 240f; float num3 = (float)this.trackBar6.Value / 240f; Color[] colorArray = this.file.PaletteData.ToColorArray(); for (int index = 0; index < colorArray.Length; ++index) { NCLR.HSLColor hslColor = (NCLR.HSLColor)colorArray[index]; hslColor.Hue += hslColor.Hue * (double)num1; hslColor.Saturation += hslColor.Saturation * (double)num2; hslColor.Luminosity += hslColor.Luminosity * (double)num3; colorArray[index] = (Color)hslColor; } this.nclrEditor1.Colors = colorArray; }
private static double GetTemp2(NCLR.HSLColor hslColor) { return(hslColor.luminosity >= 0.5 ? hslColor.luminosity + hslColor.saturation - hslColor.luminosity * hslColor.saturation : hslColor.luminosity *(1.0 + hslColor.saturation)); }