title: Change value that is outside of query in Linq select
body: <p>This is a bit outside of data topic, but I have been having hard times to figure out how it can be done. I have a chart control that is using colours for each chart section. I would like to specify constant colours for my chart so that they would be not generated randomly.</p>
  <p>Here is my linq query:</p>
  <pre><code>private void PopulateChart()
  {
    IEnumerable&lt;ISeries&gt; result = this.DataRecords
          .Where(w =&gt; w.TimeNow.Date == this.SelectedDate.Date)
          .GroupBy(g =&gt; g.Running)
          .Select(item =&gt; new PieSeries&lt;double&gt;
          {
            Values = new List&lt;double&gt; { item.Sum(x =&gt; x.Elapsed) },
            Name = item.Key ? &quot;On&quot; : &quot;Off&quot;,
            Stroke = null,
            Fill = new SolidColorPaint(SKColors.Yellow)
          });
  
    this.ChartSeries = new ObservableCollection&lt;ISeries&gt;(result);
  }
  </code></pre>
  <p>Now my colour is always Yellow = <code>SKColors.Yellow</code>. How I can make an array of colours. For example <code>SKColors.Yellow</code>, <code>SKColors.Blue</code> and then use them inside my Select to pass them for each section?</p>
  <p>Here is an array example:</p>
  <pre><code>private void PopulateChart()
  {
    SKColor[] colors = { SKColors.Yellow, SKColors.Blue };
  
    IEnumerable&lt;ISeries&gt; result = this.DataRecords
          .Where(w =&gt; w.TimeNow.Date == this.SelectedDate.Date)
          .GroupBy(g =&gt; g.Running)
          .Select(item =&gt; new PieSeries&lt;double&gt;
          {
            Values = new List&lt;double&gt; { item.Sum(x =&gt; x.Elapsed) },
            Name = item.Key ? &quot;On&quot; : &quot;Off&quot;,
            Stroke = null,
            Fill = new SolidColorPaint(colors[0])
          });
  
    this.ChartSeries = new ObservableCollection&lt;ISeries&gt;(result);
  }
  </code></pre>
  <p>So question is how to pass 0 and then 1 in <code>colors[0]</code>?</p>