/// <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);
        }
예제 #2
0
        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))
                 ));
        }
예제 #3
0
        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);
        }
예제 #4
0
 private void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
     }
 }
예제 #5
0
 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());
 }
예제 #6
0
        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
         }));
     }
 }
예제 #9
0
파일: Green.cs 프로젝트: Confirmit/Students
 public void DoSecond(Red red, Green green)
 {
     if (red != null)
         ColorsOperator.Do(red, this);
     if (green != null)
         ColorsOperator.Do(green, this);
 }
예제 #10
0
        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();
        }
예제 #11
0
        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));
        }
예제 #12
0
        public IColorVisitor <string> Visit(Green first)
        {
            var secondVisitor = CreateVisitor(first);

            secondVisitor.TakeGreen = second => _colorProcessor.Prosess(first, second);

            return(secondVisitor);
        }
예제 #13
0
파일: Colors.cs 프로젝트: taler0n/Students
 public static void Do(Red first, Green second)
 {
     if (HasNull(first, second))
     {
         return;
     }
     //Red, Green
     RedGreen = true; //just for tests
 }
예제 #14
0
파일: Colors.cs 프로젝트: taler0n/Students
 public static void Do(Green first, Red second)
 {
     if (HasNull(first, second))
     {
         return;
     }
     //Green, Green
     GreenRed = true; //just for tests
 }
예제 #15
0
파일: PovColor.cs 프로젝트: fremag/PovSharp
        public override int GetHashCode()
        {
            int hash = 17;

            hash *= 23 + Red.GetHashCode();
            hash *= 23 + Green.GetHashCode();
            hash *= 23 + Blue.GetHashCode();
            return(hash);
        }
예제 #16
0
 public override int GetHashCode()
 {
     unchecked {
         var hashCode = Red.GetHashCode();
         hashCode = (hashCode * 397) ^ Green.GetHashCode();
         hashCode = (hashCode * 397) ^ Blue.GetHashCode();
         return(hashCode);
     }
 }
예제 #17
0
        /// <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);
        }
예제 #18
0
        public override int GetHashCode()
        {
            var hashCode = -883431563;

            hashCode = hashCode * -1521134295 + Blue.GetHashCode();
            hashCode = hashCode * -1521134295 + Green.GetHashCode();
            hashCode = hashCode * -1521134295 + Red.GetHashCode();
            return(hashCode);
        }
예제 #19
0
        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);
        }
예제 #20
0
        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);
        }
예제 #21
0
 public void AutoMoveGreenForSix()
 {
     foreach (GreenPlayerScript Green in mGreenPlayers)
     {
         if (Green.mTokenOut == true && GameManagerScript.mGameManager.mGreenPlayerFinished == 3)
         {
             Green.StartTokenMovement();
         }
     }
 }
예제 #22
0
        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));
        }
예제 #23
0
 public override int GetHashCode()
 {
     unchecked
     {
         int result = Red.GetHashCode();
         result = (result * 397) ^ Green.GetHashCode();
         result = (result * 397) ^ Blue.GetHashCode();
         return(result);
     }
 }
예제 #24
0
    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));
    }
예제 #25
0
    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";
    }
예제 #26
0
        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()));
        }
예제 #27
0
        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()));
        }
예제 #28
0
파일: Green.cs 프로젝트: taler0n/Students
 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));
        }
예제 #31
0
        /// <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));
        }
예제 #32
0
        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));
        }
예제 #33
0
 public void Process(Green colorOne, Blue colorTwo)
 {
     LastProcess = TypeOfProcess.GreenAndBlue;
 }
예제 #34
0
 public void Process(Red colorOne, Green colorTwo)
 {
     LastProcess = TypeOfProcess.RedAndGreen;
 }
예제 #35
0
 public void Process(Green colorOne, Red colorTwo)
 {
     LastProcess = TypeOfProcess.GreenAndRed;
 }
예제 #36
0
 public void Process(Green colorOne, Green colorTwo)
 {
     LastProcess = TypeOfProcess.GreenAndGreen;
 }
예제 #37
0
 public void Process(Green color)
 {
     LastProcess = TypeOfProcess.Green;
 }
예제 #38
0
 public static void Do(Green first, Red second)
 {
     //Green, Green
     GreenRed = true; //just for tests
 }
예제 #39
0
 public void DrawGreen(Green g)
 {
     Turtle.SetColor(0.2, 0.9, 0.1);
 }
예제 #40
0
 public static void Do(Red first, Green second)
 {
     if (HasNull(first, second)) return;
     //Red, Green
     RedGreen = true; //just for tests
 }
예제 #41
0
 public static void Do(Green first, Red second)
 {
     if (HasNull(first, second)) return;
     //Green, Green
     GreenRed = true; //just for tests
 }
예제 #42
0
파일: Green.cs 프로젝트: Confirmit/Students
 public void DoSecond(Green first)
 {
     ColorsOperator.Do(first, this);
 }
예제 #43
0
 public void DoSecond(Green first)
 {
     if (GetRed() != null) { ColorsOperator.Do(first, GetRed()); }
     if (GetGreen() != null) { ColorsOperator.Do(first, GetGreen()); }
 }
예제 #44
0
 public void Process(Blue colorOne, Green colorTwo)
 {
     LastProcess = TypeOfProcess.BlueAndGreen;
 }
예제 #45
0
 public string Mix(Red first, Green second)
 {
     return Submix(first, second);
 }
예제 #46
0
 public void Draw(Green c)
 {
     Turtle.SetColor(c.Value.R, c.Value.G, c.Value.B);
 }
예제 #47
0
 public string Mix(Green first, Red second)
 {
     return Submix(first, second);
 }
예제 #48
0
 public void Add(Green color, int counter)
 {
     _greens[counter] = color;
     _types += "Green";
 }
예제 #49
0
 public static void Do(Red first, Green second)
 {
     //Red, Green
     RedGreen = true; //just for tests
 }