|
|
|
|
@@ -4,42 +4,142 @@ export interface ColorMapping {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const bambuLabColors: Record<string, ColorMapping> = {
|
|
|
|
|
// PLA Basic Colors
|
|
|
|
|
'Mistletoe Green': { hex: '#4F6359' },
|
|
|
|
|
'Indigo Purple': { hex: '#482960' },
|
|
|
|
|
'Alpine Green Sparkle': { hex: '#3F5443' },
|
|
|
|
|
'Apple Green': { hex: '#C6E188' },
|
|
|
|
|
'Arctic Whisper': { hex: '#ECF7F8' },
|
|
|
|
|
'Ash Grey': { hex: '#9B9EA0' },
|
|
|
|
|
'Aurora Purple': { hex: '#285BB7' },
|
|
|
|
|
'Azure': { hex: '#489FDF' },
|
|
|
|
|
'Baby Blue': { hex: '#AEC3ED' },
|
|
|
|
|
'Bambu Green': { hex: '#00AE42' },
|
|
|
|
|
'Beige': { hex: '#F7E6DE' },
|
|
|
|
|
'Black': { hex: '#000000' },
|
|
|
|
|
'Jade White': { hex: '#F5F5F5' },
|
|
|
|
|
'Gray': { hex: '#8C9091' },
|
|
|
|
|
'Grey': { hex: '#8C9091' },
|
|
|
|
|
'Red': { hex: '#C33F45' },
|
|
|
|
|
'Hot Pink': { hex: '#F5547C' },
|
|
|
|
|
'Black Walnut': { hex: '#4D4229' },
|
|
|
|
|
'Blaze': { hex: '#E78390' },
|
|
|
|
|
'Blue': { hex: '#0A2989' },
|
|
|
|
|
'Blue Grey': { hex: '#5B6579' },
|
|
|
|
|
'Blue Hawaii': { hex: '#739FE6' },
|
|
|
|
|
'Blueberry Bubblegum': { hex: '#BADCF4' },
|
|
|
|
|
'Bone White': { hex: '#C8C5B6' },
|
|
|
|
|
'Bright Green': { hex: '#BDCF00' },
|
|
|
|
|
'Brick Red': { hex: '#9F332A' },
|
|
|
|
|
'Bronze': { hex: '#847D48' },
|
|
|
|
|
'Brown': { hex: '#9D432C' },
|
|
|
|
|
'Burgundy Red': { hex: '#951E23' },
|
|
|
|
|
'Candy Green': { hex: '#408619' },
|
|
|
|
|
'Candy Red': { hex: '#BB3A2E' },
|
|
|
|
|
'Caramel': { hex: '#A4845C' },
|
|
|
|
|
'Champagne': { hex: '#EBD0B1' },
|
|
|
|
|
'Charcoal': { hex: '#000000' },
|
|
|
|
|
'Cherry Pink': { hex: '#E9B6CC' },
|
|
|
|
|
'Chocolate': { hex: '#4A3729' },
|
|
|
|
|
'Clay Brown': { hex: '#8E621A' },
|
|
|
|
|
'Clear': { hex: '#FAFAFA' },
|
|
|
|
|
'Clear Black': { hex: '#5A5161' },
|
|
|
|
|
'Cobalt Blue': { hex: '#0055B8' },
|
|
|
|
|
'Cobalt Blue Metallic': { hex: '#39699E' },
|
|
|
|
|
'Cocoa Brown': { hex: '#6F5034' },
|
|
|
|
|
'Copper Brown Metallic': { hex: '#AA6443' },
|
|
|
|
|
'Cotton Candy Cloud': { hex: '#E9E2EC' },
|
|
|
|
|
'Cream': { hex: '#F3E0B8' },
|
|
|
|
|
'Crimson Red Sparkle': { hex: '#792B36' },
|
|
|
|
|
'Cyan': { hex: '#0086D6' },
|
|
|
|
|
'Dark Blue': { hex: '#042F56' },
|
|
|
|
|
'Dark Brown': { hex: '#7D6556' },
|
|
|
|
|
'Dark Chocolate': { hex: '#4A3729' },
|
|
|
|
|
'Dark Gray': { hex: '#555555' },
|
|
|
|
|
'Dark Green': { hex: '#68724D' },
|
|
|
|
|
'Dark Red': { hex: '#BB3D43' },
|
|
|
|
|
'Dawn Radiance': { hex: '#C472A1' },
|
|
|
|
|
'Desert Tan': { hex: '#E8DBB7' },
|
|
|
|
|
'Dusk Glare': { hex: '#F6B790' },
|
|
|
|
|
'Forest Green': { hex: '#415520' },
|
|
|
|
|
'Frozen': { hex: '#A6DEF3' },
|
|
|
|
|
'Gilded Rose': { hex: '#ED982C' },
|
|
|
|
|
'Glow Blue': { hex: '#7AC0E9' },
|
|
|
|
|
'Glow Green': { hex: '#A1FFAC' },
|
|
|
|
|
'Glow Orange': { hex: '#FF9D5B' },
|
|
|
|
|
'Glow Pink': { hex: '#F17B8F' },
|
|
|
|
|
'Glow Yellow': { hex: '#F8FF80' },
|
|
|
|
|
'Gold': { hex: '#E4BD68' },
|
|
|
|
|
'Gray': { hex: '#8E9089' },
|
|
|
|
|
'Green': { hex: '#3B665E' },
|
|
|
|
|
'Hot Pink': { hex: '#F5547D' },
|
|
|
|
|
'Ice Blue': { hex: '#A3D8E1' },
|
|
|
|
|
'Indigo Blue': { hex: '#324585' },
|
|
|
|
|
'Indigo Purple': { hex: '#482A60' },
|
|
|
|
|
'Iridium Gold Metallic': { hex: '#B39B84' },
|
|
|
|
|
'Iris Purple': { hex: '#69398E' },
|
|
|
|
|
'Ivory White': { hex: '#FFFFFF' },
|
|
|
|
|
'Jade White': { hex: '#FFFFFF' },
|
|
|
|
|
'Jeans Blue': { hex: '#6E88BC' },
|
|
|
|
|
'Lake Blue': { hex: '#4672E4' },
|
|
|
|
|
'Latte Brown': { hex: '#D3B7A7' },
|
|
|
|
|
'Lava Gray': { hex: '#4D5054' },
|
|
|
|
|
'Lavender': { hex: '#B5AAD5' },
|
|
|
|
|
'Lemon Yellow': { hex: '#F7D959' },
|
|
|
|
|
'Light Blue': { hex: '#61B0FF' },
|
|
|
|
|
'Light Cyan': { hex: '#B9E3DF' },
|
|
|
|
|
'Light Gray': { hex: '#D0D2D4' },
|
|
|
|
|
'Light Jade': { hex: '#A4D6AD' },
|
|
|
|
|
'Lilac Purple': { hex: '#AE96D4' },
|
|
|
|
|
'Lime': { hex: '#C5ED48' },
|
|
|
|
|
'Lime Green': { hex: '#8EE43D' },
|
|
|
|
|
'Magenta': { hex: '#EC008C' },
|
|
|
|
|
'Malachite Green': { hex: '#16B08E' },
|
|
|
|
|
'Mandarin Orange': { hex: '#F99963' },
|
|
|
|
|
'Marine Blue': { hex: '#0078BF' },
|
|
|
|
|
'Maroon Red': { hex: '#0A2989' },
|
|
|
|
|
'Matcha Green': { hex: '#5C9748' },
|
|
|
|
|
'Mellow Yellow': { hex: '#EFDCAA' },
|
|
|
|
|
'Midnight Blaze': { hex: '#0047BB' },
|
|
|
|
|
'Mint': { hex: '#A5DAB7' },
|
|
|
|
|
'Mint Lime': { hex: '#BAF382' },
|
|
|
|
|
'Mistletoe Green': { hex: '#3F8E43' },
|
|
|
|
|
'Nardo Gray': { hex: '#747474' },
|
|
|
|
|
'Navy Blue': { hex: '#0C2340' },
|
|
|
|
|
'Nebulae': { hex: '#424379' },
|
|
|
|
|
'Neon City': { hex: '#0047BB' },
|
|
|
|
|
'Neon Green': { hex: '#ABFF1E' },
|
|
|
|
|
'Neon Orange': { hex: '#F68A1B' },
|
|
|
|
|
'Ochre Yellow': { hex: '#BC8B39' },
|
|
|
|
|
'Ocean to Meadow': { hex: '#A1E4CA' },
|
|
|
|
|
'Olive': { hex: '#748C45' },
|
|
|
|
|
'Onyx Black Sparkle': { hex: '#2D2B28' },
|
|
|
|
|
'Orange': { hex: '#FF6A13' },
|
|
|
|
|
'Oxide Green Metallic': { hex: '#1D7C6A' },
|
|
|
|
|
'Peanut Brown': { hex: '#7E5A1F' },
|
|
|
|
|
'Pink': { hex: '#F55A74' },
|
|
|
|
|
'Pink Citrus': { hex: '#F8C4BC' },
|
|
|
|
|
'Plum': { hex: '#851A52' },
|
|
|
|
|
'Pumpkin Orange': { hex: '#FF8E16' },
|
|
|
|
|
'Purple': { hex: '#5E43B7' },
|
|
|
|
|
'Red': { hex: '#C12E1F' },
|
|
|
|
|
'Red Granite': { hex: '#AD4E38' },
|
|
|
|
|
'Rose Gold': { hex: '#B29593' },
|
|
|
|
|
'Rosewood': { hex: '#472A22' },
|
|
|
|
|
'Royal Blue': { hex: '#2842AD' },
|
|
|
|
|
'Royal Purple Sparkle': { hex: '#483D8B' },
|
|
|
|
|
'Sakura Pink': { hex: '#E8AFCF' },
|
|
|
|
|
'Scarlet Red': { hex: '#DE4343' },
|
|
|
|
|
'Silver': { hex: '#A6A9AA' },
|
|
|
|
|
'Sky Blue': { hex: '#73B2E5' },
|
|
|
|
|
'Slate Gray Sparkle': { hex: '#8E9089' },
|
|
|
|
|
'Solar Breeze': { hex: '#F3D9D5' },
|
|
|
|
|
'South Beach': { hex: '#468791' },
|
|
|
|
|
'Sunflower Yellow': { hex: '#FEC601' },
|
|
|
|
|
'Tangerine Yellow': { hex: '#FFC72C' },
|
|
|
|
|
'Teal': { hex: '#77EDD7' },
|
|
|
|
|
'Terracotta': { hex: '#A25A37' },
|
|
|
|
|
'Titan Gray': { hex: '#606367' },
|
|
|
|
|
'Transparent': { hex: '#FFFFFF' },
|
|
|
|
|
'Turquoise': { hex: '#00B1B7' },
|
|
|
|
|
'Velvet Eclipse': { hex: '#000000' },
|
|
|
|
|
'Violet Purple': { hex: '#583061' },
|
|
|
|
|
'White': { hex: '#FFFFFF' },
|
|
|
|
|
'Cotton Candy Cloud': { hex: ['#E7C1D5', '#8EC9E9'], isGradient: true },
|
|
|
|
|
'Sunflower Yellow': { hex: '#FEC600' },
|
|
|
|
|
'Yellow': { hex: '#FFD700' },
|
|
|
|
|
'Magenta': { hex: '#FF00FF' },
|
|
|
|
|
'Beige': { hex: '#F5DEB3' },
|
|
|
|
|
'Cyan': { hex: '#00FFFF' },
|
|
|
|
|
|
|
|
|
|
// PLA Matte Colors
|
|
|
|
|
'Scarlet Red': { hex: '#FF2400' },
|
|
|
|
|
'Mandarin Orange': { hex: '#FF8C00' },
|
|
|
|
|
'Marine Blue': { hex: '#000080' },
|
|
|
|
|
'Charcoal': { hex: '#36454F' },
|
|
|
|
|
'Ivory White': { hex: '#FFFFF0' },
|
|
|
|
|
|
|
|
|
|
// Additional colors from filamentcolors.xyz
|
|
|
|
|
'Orange': { hex: '#FF7146' },
|
|
|
|
|
'Blue': { hex: '#4F9CCC' },
|
|
|
|
|
'Green': { hex: '#4F6359' },
|
|
|
|
|
'Dark Green': { hex: '#656A4D' },
|
|
|
|
|
'Alpine Green': { hex: '#4F6359' },
|
|
|
|
|
'Dark Gray': { hex: '#616364' },
|
|
|
|
|
'Dark Grey': { hex: '#616364' },
|
|
|
|
|
'Blue Gray': { hex: '#647988' },
|
|
|
|
|
'Blue Grey': { hex: '#647988' },
|
|
|
|
|
'Translucent Orange': { hex: '#EF8E5B' },
|
|
|
|
|
'White Marble': { hex: '#F7F3F0' },
|
|
|
|
|
'White Oak': { hex: '#D2CCA2' },
|
|
|
|
|
'Yellow': { hex: '#F4EE2A' },
|
|
|
|
|
|
|
|
|
|
// Default fallback
|
|
|
|
|
'Unknown': { hex: '#CCCCCC' }
|
|
|
|
|
@@ -84,18 +184,4 @@ export function getColorStyle(colorMapping: ColorMapping): React.CSSProperties {
|
|
|
|
|
return {
|
|
|
|
|
backgroundColor: Array.isArray(colorMapping.hex) ? colorMapping.hex[0] : colorMapping.hex
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function getContrastColor(hexColor: string): string {
|
|
|
|
|
// Convert hex to RGB
|
|
|
|
|
const hex = hexColor.replace('#', '');
|
|
|
|
|
const r = parseInt(hex.substr(0, 2), 16);
|
|
|
|
|
const g = parseInt(hex.substr(2, 2), 16);
|
|
|
|
|
const b = parseInt(hex.substr(4, 2), 16);
|
|
|
|
|
|
|
|
|
|
// Calculate relative luminance
|
|
|
|
|
const luminance = (0.299 * r + 0.587 * g + 0.114 * b) / 255;
|
|
|
|
|
|
|
|
|
|
// Return black or white based on luminance
|
|
|
|
|
return luminance > 0.5 ? '#000000' : '#FFFFFF';
|
|
|
|
|
}
|