public static void writeConfig(int sensity, int colorMode, IList<int[]> gradient, int[] gradientBGColor) { Settings cfg = new Settings(); cfg.sensity = sensity; cfg.colorMode = colorMode; cfg.gradient = gradient; cfg.gBGColor = gradientBGColor; string output = JsonConvert.SerializeObject(cfg); using (StreamWriter writer = new StreamWriter(Helper.getAppLocation() + "\\" + configFile, false)) { writer.WriteLine(output); writer.Flush(); } cfg = null; output = null; }
private static Settings getDefaultConfig() { Settings cfg = new Settings(); cfg.colorMode = 0; cfg.sensity = 1; cfg.gBGColor = new int[3] { 0, 0, 0 }; cfg.gradient = new int[6][]; cfg.gradient[0] = new int[3] { 31, 229, 0 }; cfg.gradient[1] = new int[3] { 120, 234, 2 }; cfg.gradient[2] = new int[3] { 211, 239, 5 }; cfg.gradient[3] = new int[3] { 244, 185, 8 }; cfg.gradient[4] = new int[3] { 249, 102, 11 }; cfg.gradient[5] = new int[3] { 255, 6, 17 }; return cfg; }