title: Rally percent done by story count and plan estimate color coding algorithm
body: <p>Related to <a href="https://stackoverflow.com/questions/9789001/progress-bars-for-portfolio-items/9794478#9794478">Progress Bars for Portfolio Items</a>, but now we have the SDK 2.0</p>
  
  <p>Is there a way to see the algorithm for displaying percent done by story count and percent done by story plan estimate?</p>
  
  <p>I have an attempt which is close, and works in most cases, but sometimes when I compare it to the actual information in rally, the colors differ.  I would like this to be consistent for my app:</p>
  
  <pre><code>if (recordData.PercentDoneByStoryPlanEstimate === 1) {                                                                           //All work has been accepted
      return App.colorCodes.grey;
  } else if (dateDifference &lt;= 0) {                                                                                                //End date has passed and work is not complete
      return App.colorCodes.blank;
  } else {
      if (daysSinceStart / dateDifference &lt;= recordData.PercentDoneByStoryPlanEstimate)             return App.colorCodes.green;  //On-track
      else if (daysSinceStart / dateDifference &lt;= recordData.PercentDoneByStoryPlanEstimate + 0.25) return App.colorCodes.yellow; //Within 25% of planned velocity
      else                                                                                          return App.colorCodes.red;    //Off-track, not within 10%
  }
  </code></pre>
  
  <p>Also, the <a href="https://prod.help.rallydev.com/apps/2.0rc1/doc/#!/api/Rally.ui.PercentDone" rel="nofollow noreferrer">Percent Done</a> ui component in the SDK 2.0 does not color the cards correctly either, and there is no way to provide a custom coloring function - I can provided a percentage, but can I get it to display like a native rally percent done would?</p>