/// <summary> /// Gets a bitmap with the RGB histograms /// </summary> /// <returns>Three histograms for R, G and B values in the Histogram</returns> public Bitmap Visualize() { int oneColorHeight = 100; int margin = 10; float[] maxValues = new float[] { Red.Max(), Green.Max(), Blue.Max() }; byte[][] values = new byte[][] { Red, Green, Blue }; Bitmap histogramBitmap = new Bitmap(276, oneColorHeight * 3 + margin * 4); Graphics g = Graphics.FromImage(histogramBitmap); g.FillRectangle(Brushes.White, 0, 0, histogramBitmap.Width, histogramBitmap.Height); int yOffset = margin + oneColorHeight; for (int i = 0; i < 256; i++) { for (int color = 0; color < 3; color++) { g.DrawLine(p[color], margin + i, yOffset * (color + 1), margin + i, yOffset * (color + 1) - (values[color][i] / maxValues[color]) * oneColorHeight); } } for (int i = 0; i < 3; i++) { g.DrawString(p[i].Color.ToKnownColor() + ", max value: " + maxValues[i], SystemFonts.SmallCaptionFont, Brushes.Silver, margin + 11, yOffset * i + margin + margin + 1); g.DrawString(p[i].Color.ToKnownColor() + ", max value: " + maxValues[i], SystemFonts.SmallCaptionFont, Brushes.Black, margin + 10, yOffset * i + margin + margin); g.DrawRectangle(p[i], margin, yOffset * i + margin, 256, oneColorHeight); } g.Dispose(); return(histogramBitmap); }
public bool Equals(DestinyColor input) { if (input == null) { return(false); } return (( Red == input.Red || (Red != null && Red.Equals(input.Red)) ) && ( Green == input.Green || (Green != null && Green.Equals(input.Green)) ) && ( Blue == input.Blue || (Blue != null && Blue.Equals(input.Blue)) ) && ( Alpha == input.Alpha || (Alpha != null && Alpha.Equals(input.Alpha)) )); }
public override int GetHashCode() { int hash = 1; if (Red != 0) { hash ^= Red.GetHashCode(); } if (Green != 0) { hash ^= Green.GetHashCode(); } if (Blue != 0) { hash ^= Blue.GetHashCode(); } if (Alpha != 0) { hash ^= Alpha.GetHashCode(); } if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
private void Awake() { if (Instance == null) { Instance = this; } }
public override void WriteXml(XmlWriter writer) { writer.WriteAttributeString("r", Red.ToStringRoundtrip()); writer.WriteAttributeString("g", Green.ToStringRoundtrip()); writer.WriteAttributeString("b", Blue.ToStringRoundtrip()); writer.WriteAttributeString("a", Alpha.ToStringRoundtrip()); }
public SettingsPage() { InitializeComponent(); InnerButtonClose.IsVisible = false; InnerButtonMenu.IsVisible = true; ConnectOpenWithClick(); ConnectCloseWithClick(); ConnectWithClick(); if (App.geometryInteractor.ColorForVisitedPolygon == Color.FromRgba(54, 138, 239, 100)) { Blue.ScaleTo(1.3, 1); } else if (App.geometryInteractor.ColorForVisitedPolygon == Color.FromRgba(255, 214, 0, 100)) { Yellow.ScaleTo(1.3, 1); } else if (App.geometryInteractor.ColorForVisitedPolygon == Color.FromRgba(255, 23, 68, 100)) { Red.ScaleTo(1.3, 1); } else if (App.geometryInteractor.ColorForVisitedPolygon == Color.FromRgba(0, 200, 83, 100)) { Green.ScaleTo(1.3, 1); } }
/// <summary> /// Setup the dice for the turn /// </summary> /// <param name="dice">Number of dice to roll</param> internal static void Setup(int dice) { Array.Clear(Tally, 0, Tally.Length); Rolling.ForEach(die => die.Save = false); if (Rolling.Count == dice) { return; } while (Rolling.Count != 0) { if (Rolling[0].Color == Color.Black) { Black.Push(Rolling[0]); } else { Green.Push(Rolling[0]); } Rolling.RemoveAt(0); } while (dice-- >= 0 && Black.Count != 0) { Rolling.Add(Black.Pop()); } while (dice-- >= 0 && Green.Count != 0) { Rolling.Add(Green.Pop()); } }
public ActionResult <ResponseContext> Create(Green green) { try { if ((bool)HttpContext.Items["isLoggedInOtherDevice"]) { return(Ok(new ResponseContext { code = (int)Common.ResponseCode.IS_LOGGED_IN_ORTHER_DEVICE, message = Common.Message.IS_LOGGED_IN_ORTHER_DEVICE, data = null })); } var newgreen = new Green(); newgreen = _greenServices.Create(green); return(Ok(new ResponseContext { code = (int)Common.ResponseCode.SUCCESS, message = Common.Message.SUCCESS, data = newgreen })); } catch (Exception ex) { _logger.LogError(ex, ex.Message); return(StatusCode(StatusCodes.Status500InternalServerError, new ResponseMessage { status = "ERROR", message = ex.Message })); } }
public void DoSecond(Red red, Green green) { if (red != null) ColorsOperator.Do(red, this); if (green != null) ColorsOperator.Do(green, this); }
protected override void WriteDataXML(XElement ele, ElderScrollsPlugin master) { XElement subEle; ele.TryPathTo("Bounds/X", true, out subEle); subEle.Value = XBound.ToString("G15"); ele.TryPathTo("Bounds/Y", true, out subEle); subEle.Value = YBound.ToString("G15"); ele.TryPathTo("Bounds/Z", true, out subEle); subEle.Value = ZBound.ToString("G15"); ele.TryPathTo("Color/Red", true, out subEle); subEle.Value = Red.ToString("G15"); ele.TryPathTo("Color/Green", true, out subEle); subEle.Value = Green.ToString("G15"); ele.TryPathTo("Color/Blue", true, out subEle); subEle.Value = Blue.ToString("G15"); ele.TryPathTo("Unknown", true, out subEle); subEle.Value = Unknown.ToHex(); ele.TryPathTo("Type", true, out subEle); subEle.Value = Type.ToString(); }
public byte[] ToRGBBytes() { string red = Red.ToString().PadLeft(3, '0'); string green = Green.ToString().PadLeft(3, '0'); string blue = Blue.ToString().PadLeft(3, '0'); return(Encoding.ASCII.GetBytes(red + green + blue)); }
public IColorVisitor <string> Visit(Green first) { var secondVisitor = CreateVisitor(first); secondVisitor.TakeGreen = second => _colorProcessor.Prosess(first, second); return(secondVisitor); }
public static void Do(Red first, Green second) { if (HasNull(first, second)) { return; } //Red, Green RedGreen = true; //just for tests }
public static void Do(Green first, Red second) { if (HasNull(first, second)) { return; } //Green, Green GreenRed = true; //just for tests }
public override int GetHashCode() { int hash = 17; hash *= 23 + Red.GetHashCode(); hash *= 23 + Green.GetHashCode(); hash *= 23 + Blue.GetHashCode(); return(hash); }
public override int GetHashCode() { unchecked { var hashCode = Red.GetHashCode(); hashCode = (hashCode * 397) ^ Green.GetHashCode(); hashCode = (hashCode * 397) ^ Blue.GetHashCode(); return(hashCode); } }
/// <inheritdoc/> public override int GetHashCode() { int hashCode = -1058441243; hashCode = hashCode * -1521134295 + Red.GetHashCode(); hashCode = hashCode * -1521134295 + Green.GetHashCode(); hashCode = hashCode * -1521134295 + Blue.GetHashCode(); return(hashCode); }
public override int GetHashCode() { var hashCode = -883431563; hashCode = hashCode * -1521134295 + Blue.GetHashCode(); hashCode = hashCode * -1521134295 + Green.GetHashCode(); hashCode = hashCode * -1521134295 + Red.GetHashCode(); return(hashCode); }
public override int GetHashCode() { int hashCode = -1520100960; hashCode = hashCode * -1521134295 + Red.GetHashCode(); hashCode = hashCode * -1521134295 + Green.GetHashCode(); hashCode = hashCode * -1521134295 + Blue.GetHashCode(); hashCode = hashCode * -1521134295 + Alpha.GetHashCode(); return(hashCode); }
static void Main(string[] args) { var red = new Red(); var green = new Green(); Console.WriteLine(red.ToString()); Console.WriteLine(green.ToString()); // Console.WriteLine(red.GetMyType()); // ColorsProcessor.Process(red, green); }
public void AutoMoveGreenForSix() { foreach (GreenPlayerScript Green in mGreenPlayers) { if (Green.mTokenOut == true && GameManagerScript.mGameManager.mGreenPlayerFinished == 3) { Green.StartTokenMovement(); } } }
private Color GetRGB(long RGB) { long Red, Green, Blue; Red = RGB & 255; Green = RGB % 256 & 255; Blue = RGB % 256 ^ 2 & 255; Console.WriteLine("RGB: " + Blue.ToString() + ", " + Green.ToString() + ", " + Red.ToString()); return(Color.FromArgb((int)Blue, (int)Green, (int)Red)); }
public override int GetHashCode() { unchecked { int result = Red.GetHashCode(); result = (result * 397) ^ Green.GetHashCode(); result = (result * 397) ^ Blue.GetHashCode(); return(result); } }
public RazorDirectiveSyntax WithDirectiveDescriptor(DirectiveDescriptor descriptor) { var annotations = new List <SyntaxAnnotation>(GetAnnotations()) { new SyntaxAnnotation(DirectiveDescriptorKey, descriptor) }; var newGreen = Green.WithAnnotationsGreen(annotations.ToArray()); return((RazorDirectiveSyntax)newGreen.CreateRed(Parent, Position)); }
void Start() { red = this.gameObject.GetComponent <Red>(); green = this.gameObject.GetComponent <Green>(); blue = this.gameObject.GetComponent <Blue>(); gray = this.gameObject.GetComponent <Grayscale>(); lastSwitch = Time.time; current = "grey"; }
public override string GetStepParameters() { var parameters = new List <string>(); parameters.Add(Name != null ? Name.ToStepValue() : "$"); parameters.Add(Red != null ? Red.ToStepValue() : "$"); parameters.Add(Green != null ? Green.ToStepValue() : "$"); parameters.Add(Blue != null ? Blue.ToStepValue() : "$"); return(string.Join(", ", parameters.ToArray())); }
public void Green() { Wire wire = new Green(); Assert.AreEqual(ResultType.Disarm, wire.Cut(new White())); Assert.AreEqual(ResultType.Explode, wire.Cut(new Red())); Assert.AreEqual(ResultType.Explode, wire.Cut(new Black())); Assert.AreEqual(ResultType.Disarm, wire.Cut(new Orange())); Assert.AreEqual(ResultType.Explode, wire.Cut(new Green())); Assert.AreEqual(ResultType.Explode, wire.Cut(new Purple())); }
public void DoSecond(Red red, Green green) { if (red != null) { ColorsOperator.Do(red, this); } if (green != null) { ColorsOperator.Do(green, this); } }
void Start() { red = this.gameObject.GetComponent<Red>(); green = this.gameObject.GetComponent<Green>(); blue = this.gameObject.GetComponent<Blue>(); gray = this.gameObject.GetComponent<Grayscale>(); lastSwitch = Time.time; current = "grey"; }
public MarkupTagHelperElementSyntax WithTagHelperInfo(TagHelperInfo info) { var annotations = new List <SyntaxAnnotation>(GetAnnotations()) { new SyntaxAnnotation(TagHelperInfoKey, info) }; var newGreen = Green.WithAnnotationsGreen(annotations.ToArray()); return((MarkupTagHelperElementSyntax)newGreen.CreateRed(Parent, Position)); }
/// <summary>Gets a hash code for the current instance.</summary> /// <returns>A hash code for the current instance.</returns> public override int GetHashCode() { var combinedValue = 0; { combinedValue = CombineValue(Red.GetHashCode(), combinedValue); combinedValue = CombineValue(Green.GetHashCode(), combinedValue); combinedValue = CombineValue(Blue.GetHashCode(), combinedValue); } return(FinalizeValue(combinedValue, sizeof(float) * 3)); }
public MarkupMinimizedTagHelperDirectiveAttributeSyntax WithTagHelperAttributeInfo(TagHelperAttributeInfo info) { var annotations = new List <SyntaxAnnotation>(GetAnnotations()) { new SyntaxAnnotation(TagHelperAttributeInfoKey, info) }; var newGreen = Green.WithAnnotationsGreen(annotations.ToArray()); return((MarkupMinimizedTagHelperDirectiveAttributeSyntax)newGreen.CreateRed(Parent, Position)); }
public void Process(Green colorOne, Blue colorTwo) { LastProcess = TypeOfProcess.GreenAndBlue; }
public void Process(Red colorOne, Green colorTwo) { LastProcess = TypeOfProcess.RedAndGreen; }
public void Process(Green colorOne, Red colorTwo) { LastProcess = TypeOfProcess.GreenAndRed; }
public void Process(Green colorOne, Green colorTwo) { LastProcess = TypeOfProcess.GreenAndGreen; }
public void Process(Green color) { LastProcess = TypeOfProcess.Green; }
public static void Do(Green first, Red second) { //Green, Green GreenRed = true; //just for tests }
public void DrawGreen(Green g) { Turtle.SetColor(0.2, 0.9, 0.1); }
public static void Do(Red first, Green second) { if (HasNull(first, second)) return; //Red, Green RedGreen = true; //just for tests }
public static void Do(Green first, Red second) { if (HasNull(first, second)) return; //Green, Green GreenRed = true; //just for tests }
public void DoSecond(Green first) { ColorsOperator.Do(first, this); }
public void DoSecond(Green first) { if (GetRed() != null) { ColorsOperator.Do(first, GetRed()); } if (GetGreen() != null) { ColorsOperator.Do(first, GetGreen()); } }
public void Process(Blue colorOne, Green colorTwo) { LastProcess = TypeOfProcess.BlueAndGreen; }
public string Mix(Red first, Green second) { return Submix(first, second); }
public void Draw(Green c) { Turtle.SetColor(c.Value.R, c.Value.G, c.Value.B); }
public string Mix(Green first, Red second) { return Submix(first, second); }
public void Add(Green color, int counter) { _greens[counter] = color; _types += "Green"; }
public static void Do(Red first, Green second) { //Red, Green RedGreen = true; //just for tests }