title: How to dynamically set pie piece text colour on a C3 chart
body: <p>I have a C3 pie chart similar to <a href="http://c3js.org/samples/chart_pie.html" rel="nofollow noreferrer">this</a> online example. In my case I set the data.colors based on incoming external data. </p>
  
  <p>My setup looks like the following (I pass in the colors to use)...</p>
  
  <pre><code>        this.pieChart = generate({
              data: {
                columns: columns,
                colors: colours,
                type: 'pie',
                onclick: (e) =&gt; {
                  this.handlePieClick(e.id);
                },
              },
              bindto: '#pie-chart',
              tooltip: {
                show: false
              },
              transition: {
                duration: 1000
              },
              legend: {
                item: {
                  onclick: id =&gt; {
                    this.handlePieClick(id);
                  }
                }
              },
            });
  </code></pre>
  
  <p>My app has not control over these colors. When the colors are light, the white text is hard to see. I may have a mixture of light and dark colours. What I need to do is examine each color and then be able to set the text either white or black for each pie piece text color, however I can see no callback function I can override to do this.</p>
  
  <p>Does anyone know a way to do this? The big thing being I have no control over the colors coming in, and need to set the text colors in code once I have the color data.</p>
  
  <p>Thanks in advance for any help!</p>