MCPcopy Create free account
hub / github.com/chartbrew/chartbrew / getSafeFallback

Function getSafeFallback

client/src/modules/colorPicker.js:5–7  ·  view source on GitHub ↗
(fallback)

Source from the content-addressed store, hash-verified

3const TRANSPARENT_COLOR_VALUES = new Set(["transparent", "rgba(0,0,0,0)", "rgba(0, 0, 0, 0)"]);
4
5function getSafeFallback(fallback) {
6 return typeof fallback === "string" && fallback.trim() ? fallback : "#000000";
7}
8
9export function normalizeColorForPicker(color, fallback = "#000000") {
10 if (color && typeof color === "object" && typeof color.toString === "function") {

Callers 1

normalizeColorForPickerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected