コード例 #1
0
ファイル: ColorGenerator.cs プロジェクト: im1sha/algorithms
            public string NextIntensity(int index)
            {
                if (index == 0)
                {
                    current = TOTAL_COLORS_PER_CHANNEL - 1;
                }
                else if (index % TOTAL_PATTERNS == 0)
                {
                    if (walker == null)
                    {
                        walker = new IntensityValueWalker();
                    }
                    else
                    {
                        walker.MoveNext();
                    }
                    current = walker.Current.Value;
                }
                string currentText = current.ToString("X");

                if (currentText.Length == 1)
                {
                    currentText = "0" + currentText;
                }
                return(currentText);
            }
コード例 #2
0
            public string NextIntensity(int index)
            {
                if (index == 0)
                {
                    current = 255;
                }
                else if (index % 7 == 0)
                {
                    if (walker == null)
                    {
                        walker = new IntensityValueWalker();
                    }
                    else
                    {
                        walker.MoveNext();
                    }

                    current = walker.Current.Value;
                }
                string currentText = current.ToString("X");

                if (currentText.Length == 1)
                {
                    currentText = "0" + currentText;
                }

                return(currentText);
            }
コード例 #3
0
            public string NextIntensity(int index)
            {
                if (index == 0)
                {
                    _current = 255;
                }
                else if (index % 7 == 0)
                {
                    if (_walker == null)
                    {
                        _walker = new IntensityValueWalker();
                    }
                    else
                    {
                        _walker.MoveNext();
                    }
                    _current = _walker.Current.Value;
                }
                string currentText = _current.ToString("X", CultureInfo.InvariantCulture);

                if (currentText.Length == 1)
                {
                    currentText = "0" + currentText;
                }

                return(currentText);
            }