@netdata/charts
Version:
Netdata frontend SDK and chart utilities
29 lines (28 loc) • 1.02 kB
JavaScript
;
var _helpers = require("./helpers");
describe("darkenColor", function () {
it("darkens RGB color strings", function () {
var result = (0, _helpers.darkenColor)("rgb(100, 150, 200)");
expect(result).toBe("rgb(177,202,227)");
});
it("darkens hex colors", function () {
var result = (0, _helpers.darkenColor)("#ff0000");
expect(result).toBe("rgb(255,127,127)");
});
it("darkens blue hex color", function () {
var result = (0, _helpers.darkenColor)("#0000ff");
expect(result).toBe("rgb(127,127,255)");
});
it("handles black color", function () {
var result = (0, _helpers.darkenColor)("#000000");
expect(result).toBe("rgb(127,127,127)");
});
it("handles white color", function () {
var result = (0, _helpers.darkenColor)("#ffffff");
expect(result).toBe("rgb(255,255,255)");
});
it("handles edge case with rgb(0,0,0)", function () {
var result = (0, _helpers.darkenColor)("rgb(0,0,0)");
expect(result).toBe("rgb(127,127,127)");
});
});