@@ -178,6 +178,54 @@ via a function through the `getColor` attribute.
178178Hex colors are converted to Chart.js colors automatically,
179179including different shades for highlight, fill, stroke, etc.
180180
181+ RGB colors may be input by using a string in the format "rgb(r,g,b)".
182+
183+ ## Example - RGB Colors
184+
185+ ```
186+ angular.module('app',['chart.js'])
187+ .controller('MainController', function($scope){
188+ $scope.colors = ["rgb(159,204,0)","rgb(250,109,33)","rgb(154,154,154)"];
189+ $scope.labels = ["Green", "Orange", "Grey"];
190+ $scope.data = [300, 500, 100];
191+ });
192+ ```
193+
194+ RGBA colors may also be input by using a string in the format "rgba(r,g,b,a)".
195+ They may be used alongside RGB colors and/or Hex colors.
196+
197+ ## Example - RGBA Colors
198+ ```
199+ angular.module('app',['chart.js'])
200+ .controller('MainController', function($scope){
201+ $scope.colors = ["rgba(159,204,0,0.5)","rgba(250,109,33,0.7)","rgba(154,154,154,0.5)"];
202+ $scope.labels = ["Green", "Orange", "Grey"];
203+ $scope.data = [300, 500, 100];
204+ });
205+ ```
206+
207+ Colors may also be input as an object by using the format in the example below.
208+ Colors input as objects, Hex colors, RGB, and RGBA colors may be mixed and matched.
209+
210+ ## Example - input color as an object
211+ ```
212+ angular.module('app',['chart.js'])
213+ .controller('MainController', function($scope){
214+ $scope.colors = [
215+ {
216+ backgroundColor: "rgba(159,204,0, 0.2)",
217+ pointBackgroundColor: "rgba(159,204,0, 1)",
218+ pointHoverBackgroundColor: "rgba(159,204,0, 0.8)",
219+ borderColor: "rgba(159,204,0, 1)",
220+ pointBorderColor: '#fff',
221+ pointHoverBorderColor: "rgba(159,204,0, 1)"
222+ },"rgba(250,109,33,0.5)","#9a9a9a","rgb(233,177,69)"
223+ ];
224+ $scope.labels = ["Green", "Peach", "Grey", "Orange"];
225+ $scope.data = [300, 500, 100, 150];
226+ });
227+ ```
228+
181229## Browser compatibility
182230
183231For IE8 and older browsers, you will need
0 commit comments