/* MAY REMOVE TO PREVENT CONFLICT WITH CMYK COLORSPACE * /// <summary> * /// Gets the jSon Object for TheColorAPI data using ColorfulSchemeJsonParser. * /// </summary> * /// <param name="r">Value for Red</param> * /// <param name="g">Value for Green</param> * /// <param name="b">Value for Blue</param> * /// <param name="count">Number of colors to be included with the scheme. (Note: uses absolute value)</param> * /// <returns>An Analogic scheme of (count) colors based on the color requested.</returns> * public static async Task<object> getSchemeApiJson(int r, int g, int b, int count) * { * string url = string.Format(apiSchemeUrl, rgbUrlParams); * url = string.Format(url, r, g, b) + schemeCountParam; * url = string.Format(url, Math.Abs(count)); * * return await hitApiWithUrl(url, new DataContractJsonSerializer(typeof(ColorfulSchemeJsonParser))); * } */ /// <summary> /// Gets the jSon Object for TheColorAPI data using ColorfulSchemeJsonParser. /// </summary> /// <param name="r">Value for Red</param> /// <param name="g">Value for Green</param> /// <param name="b">Value for Blue</param> /// <param name="mode">The scheme mode required for the request.</param> /// <returns>The desired (mode) scheme of 5 colors based on the color requested.</returns> public static async Task <object> getSchemeApiJson(int r, int g, int b, scheme mode) { string url = string.Format(apiSchemeUrl, rgbUrlParams); url = string.Format(url, r, g, b) + schemeModeParam; url = string.Format(url, Enum.GetName(typeof(scheme), mode)); return(await hitApiWithUrl(url, new DataContractJsonSerializer(typeof(ColorfulSchemeJsonParser)))); }
private void _checkboxclear() { textBox.Text = ""; checkBox_1.IsChecked = false; checkBox_2.IsChecked = false; checkBox_3.IsChecked = false; checkBox_4.IsChecked = false; checkBox_p.IsChecked = false; checkBox_l.IsChecked = false; checkBox_f.IsChecked = false; checkBox_v.IsChecked = false; checkBox_s1.IsChecked = false; checkBox_s2.IsChecked = false; checkBox_s3.IsChecked = false; checkBox_s4.IsChecked = false; checkBox_PW.IsChecked = false; sch1 = new scheme(); sch2 = new scheme(); isch = 1; checkbox_T.IsChecked = false; }
=> $"{SchemeUrl(scheme)}{hostname}{port::#}";
=> _controller = new GpioController(scheme, driver);
/// <summary> /// Gets the ColorfulSchemeRestProperty for a color. /// </summary> /// <param name="r">Value for Red</param> /// <param name="g">Value for Green</param> /// <param name="b">Value for Blue</param> /// <param name="mode">The desired mode for the ColorfulSchemeRestProperty (Default: Analogic)</param> /// <param name="count">The desired number of colors for the ColorfulSchemeRestProperty (Default: 5)</param> /// <returns>A new ColorfulSchemeRestProperty with the provided parameters..</returns> public static async Task<ColorfulSchemeRestProperty> getColorfulSchemeRestProperty(int r, int g, int b, scheme mode = scheme.Analogic, int count = 5) { object json = await getSchemeApiJson(r, g, b, mode, count); return new ColorfulSchemeRestProperty(json); }
/// <summary> /// Gets the jSon Object for TheColorAPI data using ColorfulSchemeJsonParser. /// </summary> /// <param name="r">Value for Red</param> /// <param name="g">Value for Green</param> /// <param name="b">Value for Blue</param> /// <param name="mode">The scheme mode required for the request.</param> /// <param name="count">Number of colors to be included with the scheme. (Note: uses absolute value)</param> /// <returns>The desired (mode) scheme of (count) colors based on the color requested.</returns> public static async Task<object> getSchemeApiJson(int r, int g, int b, scheme mode, int count) { string url = string.Format(apiSchemeUrl, rgbUrlParams); url = string.Format(url, r, g, b) + schemeCountParam; url = string.Format(url, Math.Abs(count)) + schemeModeParam; url = string.Format(url, Enum.GetName(typeof(scheme), mode)); ; return await hitApiWithUrl(url, new DataContractJsonSerializer(typeof(ColorfulSchemeJsonParser))); }
/// <summary> /// Gets the ColorfulSchemeRestProperty for a color. /// </summary> /// <param name="r">Value for Red</param> /// <param name="g">Value for Green</param> /// <param name="b">Value for Blue</param> /// <param name="mode">The desired mode for the ColorfulSchemeRestProperty (Default: Analogic)</param> /// <param name="count">The desired number of colors for the ColorfulSchemeRestProperty (Default: 5)</param> /// <returns>A new ColorfulSchemeRestProperty with the provided parameters..</returns> public static async Task <ColorfulSchemeRestProperty> getColorfulSchemeRestProperty(int r, int g, int b, scheme mode = scheme.Analogic, int count = 5) { object json = await getSchemeApiJson(r, g, b, mode, count); return(new ColorfulSchemeRestProperty(json)); }
private scheme decode_scheme() { push("scheme"); bool decoded = true; int s0 = index; var e0 = new List<Rule>(); Rule rule; decoded = false; if (!decoded) { { var e1 = new List<Rule>(); int s1 = index; decoded = true; if (decoded) { bool f1 = true; int c1 = 0; for (int i1 = 0; i1 < 1 && f1; i1++) { rule = decode_ALPHA(); if ((f1 = rule != null)) { e1.Add(rule); c1++; } } decoded = c1 == 1; } if (decoded) { bool f1 = true; int c1 = 0; while (f1) { decoded = false; if (!decoded) { { var e2 = new List<Rule>(); int s2 = index; decoded = true; if (decoded) { bool f2 = true; int c2 = 0; for (int i2 = 0; i2 < 1 && f2; i2++) { rule = decode_ALPHA(); if ((f2 = rule != null)) { e2.Add(rule); c2++; } } decoded = c2 == 1; } if (decoded) e1.AddRange(e2); else index = s2; } } if (!decoded) { { var e2 = new List<Rule>(); int s2 = index; decoded = true; if (decoded) { bool f2 = true; int c2 = 0; for (int i2 = 0; i2 < 1 && f2; i2++) { rule = decode_DIGIT(); if ((f2 = rule != null)) { e2.Add(rule); c2++; } } decoded = c2 == 1; } if (decoded) e1.AddRange(e2); else index = s2; } } if (!decoded) { { var e2 = new List<Rule>(); int s2 = index; decoded = true; if (decoded) { bool f2 = true; int c2 = 0; for (int i2 = 0; i2 < 1 && f2; i2++) { rule = decode_StringValue("+"); if ((f2 = rule != null)) { e2.Add(rule); c2++; } } decoded = c2 == 1; } if (decoded) e1.AddRange(e2); else index = s2; } } if (!decoded) { { var e2 = new List<Rule>(); int s2 = index; decoded = true; if (decoded) { bool f2 = true; int c2 = 0; for (int i2 = 0; i2 < 1 && f2; i2++) { rule = decode_StringValue("-"); if ((f2 = rule != null)) { e2.Add(rule); c2++; } } decoded = c2 == 1; } if (decoded) e1.AddRange(e2); else index = s2; } } if (!decoded) { { var e2 = new List<Rule>(); int s2 = index; decoded = true; if (decoded) { bool f2 = true; int c2 = 0; for (int i2 = 0; i2 < 1 && f2; i2++) { rule = decode_StringValue("."); if ((f2 = rule != null)) { e2.Add(rule); c2++; } } decoded = c2 == 1; } if (decoded) e1.AddRange(e2); else index = s2; } } if (decoded) c1++; f1 = decoded; } decoded = true; } if (decoded) e0.AddRange(e1); else index = s1; } } rule = null; if (decoded) rule = new scheme(text.Substring(s0, index - s0), e0); else index = s0; pop("scheme", decoded, index - s0); return (scheme)rule; }
public scheme(scheme rule) : base(rule.spelling, rule.rules) { }