IO-1722 adjusted logic for card color
This commit is contained in:
@@ -7,10 +7,13 @@ const CardColorLegend = ({ bodyshop }) => {
|
|||||||
const data = bodyshop.ssbuckets.map((bucket) => {
|
const data = bodyshop.ssbuckets.map((bucket) => {
|
||||||
let color = { r: 255, g: 255, b: 255 };
|
let color = { r: 255, g: 255, b: 255 };
|
||||||
|
|
||||||
if (bucket.color.rgb) {
|
if (bucket.color) {
|
||||||
color = bucket.color.rgb;
|
color = bucket.color;
|
||||||
|
|
||||||
|
if (bucket.color.rgb) {
|
||||||
|
color = bucket.color.rgb;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
color = bucket.color; // default to white
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
label: bucket.label,
|
label: bucket.label,
|
||||||
|
|||||||
@@ -24,11 +24,17 @@ const cardColor = (ssbuckets, totalHrs) => {
|
|||||||
bucket.gte <= totalHrs && (!!bucket.lt ? bucket.lt > totalHrs : true)
|
bucket.gte <= totalHrs && (!!bucket.lt ? bucket.lt > totalHrs : true)
|
||||||
)[0];
|
)[0];
|
||||||
|
|
||||||
if (bucket.color.rgb) {
|
let color = { r: 255, g: 255, b: 255 };
|
||||||
return bucket.color.rgb;
|
|
||||||
|
if (bucket && bucket.color) {
|
||||||
|
color = bucket.color;
|
||||||
|
|
||||||
|
if (bucket.color.rgb) {
|
||||||
|
color = bucket.color.rgb;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return bucket.color ?? { r: 255, g: 255, b: 255 }; // default to white
|
return color;
|
||||||
};
|
};
|
||||||
|
|
||||||
function getContrastYIQ(bgColor) {
|
function getContrastYIQ(bgColor) {
|
||||||
|
|||||||
Reference in New Issue
Block a user