示例#1
0
        public void SetChannel(ColorChannel channel, float[] colors, int start = 0, int length = Int32.MaxValue)
        {
            int n = Math.Min(Math.Min(Size - start, length), colors.Length);

            for (int i = 0; i < n; ++i)
            {
                _colors[i + start] = ColorSupport.ChannelSetter(channel, Space)(_colors[i + start], colors[i]);
            }
        }
示例#2
0
        public float[] GetChannel(ColorChannel channel)
        {
            float[] d0 = new float[Size];
            for (int i = 0; i < Size; ++i)
            {
                d0[i] = ColorSupport.ChannelGetter(channel, Space)(_colors[i]);
            }

            return(d0);
        }
        public PointSeries GetControlPoints(ColorChannel channel, ColorSpace space = ColorSpace.sRGB)
        {
            PointSeries         pp     = new PointSeries();
            Func <Color, float> getter = ColorSupport.ChannelGetter(channel, space);

            foreach (PaletteEntry entry in this)
            {
                pp.Add(new Point((double)entry.Index, getter(entry.Color)));
            }

            return(pp);
        }