@nativescript-community/ui-chart
Version:
A powerful chart / graph plugin, supporting line, bar, pie, radar, bubble, and candlestick charts as well as scaling, panning and animations.
51 lines (50 loc) • 1.44 kB
JavaScript
import { Color } from '@nativescript/core';
/**
* Class that holds predefined color integer arrays (e.g.
* ColorTemplate.VORDIPLOM_COLORS) and convenience methods for loading colors
* from resources.
*
*/
export class ColorTemplate {
static get LIBERTY_COLORS() {
return require('./colors/liberty').colors;
}
static get JOYFUL_COLORS() {
return require('./colors/joyful').colors;
}
static get PASTEL_COLORS() {
return require('./colors/pastel').colors;
}
static get COLORFUL_COLORS() {
return require('./colors/colorful').colors;
}
static get VORDIPLOM_COLORS() {
return require('./colors/vordiplom').colors;
}
static get MATERIAL_COLORS() {
return require('./colors/material').colors;
}
static getColorInstance(c) {
return c instanceof Color ? c : new Color(c);
}
/**
* Sets the alpha component of the given color.
*
* @param color
* @param alpha 0 - 255
* @return
*/
static colorWithAlpha(color, alpha) {
return new Color(alpha, color.r, color.g, color.b);
}
}
/**
* an "invalid" color that indicates that no color is set
*/
ColorTemplate.COLOR_NONE = new Color(-1);
/**
* this "color" is used for the Legend creation and indicates that the next
* form should be skipped
*/
ColorTemplate.COLOR_SKIP = new Color(0x00112234);
//# sourceMappingURL=ColorTemplate.js.map