How to use the @hpcc-js/common.Palette.textColor function in @hpcc-js/common

To help you get started, we’ve selected a few @hpcc-js/common examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hpcc-systems / Visualization / packages / map / src / leaflet / ClusterCircles.ts View on Github external
protected createIcon(childCount: number, backColor: string, format: (_: any) => any) {
        const borderColor = d3Hsl(backColor);
        borderColor.opacity = 0.5;
        return new DivIcon({
            className: "cluster-circle",
            iconSize: new Point(40, 40),
            html: `<div style="opacity:${this.opacity()};background-color:${borderColor.toString()}"><div style="background-color:${backColor}"><span style="color:${Palette.textColor(backColor)}">${format(childCount)}</span></div></div>`
        });
    }
github hpcc-systems / Visualization / packages / dgrid / src / Table.ts View on Github external
return function (this: ColumnType, row: RowType, cell: any, cellElement: HTMLElement): HTMLElement | void {
        const pal = palettes[this.idx];
        if (pal) {
            const background = pal.palette(cell, pal.min, pal.max);
            d3Select(cellElement)
                .style("background", background)
                .style("color", Palette.textColor(background))
                ;
        }
        cellElement.innerText = defaultFormatter.call(this, cell, row);
    };
}
github hpcc-systems / Visualization / packages / api / src / INDChart.ts View on Github external
INDChart.prototype.textColor = function (row: any[], column: string, value: number): string {
    return Palette.textColor(this.fillColor(row, column, value));
};
github hpcc-systems / Visualization / packages / api / src / I2DChart.ts View on Github external
I2DChart.prototype.textColor = function (row: any[], column, value): string {
    return Palette.textColor(this.fillColor(row, column, value));
};