private static Color ReadHSBColor(EndianBinaryReader reader) { ushort x = reader.ReadUInt16(); ushort y = reader.ReadUInt16(); ushort z = reader.ReadUInt16(); reader.ReadUInt16(); float h = x / 182.04f; float s = y / 655.35f; float b = z / 655.35f; return(ColorSpaceHelper.HSBtoColor(h, s, b)); }
public override Color BlendColor(Color l, Color r) { Color c = r; HSB hsv = ColorSpaceHelper.RGBtoHSB(c); hsv.Brightness += (((IsPreview ? _noise : _noise2).NextDouble() - 0.5f) * 2) * GlobalSettings.NoiseSaturation; if (hsv.Brightness < 0) { hsv.Brightness = 0; } if (hsv.Brightness > 1) { hsv.Brightness = 1; } return(Color.FromArgb(r.A, ColorSpaceHelper.HSBtoColor(hsv))); }