{"id":8310177,"date":"2025-09-04T09:40:03","date_gmt":"2025-09-04T06:40:03","guid":{"rendered":"https:\/\/elementor.com\/tools\/?p=8310177"},"modified":"2025-09-04T09:41:25","modified_gmt":"2025-09-04T06:41:25","slug":"12-color-palette-generator","status":"publish","type":"post","link":"https:\/\/elementor.com\/tools\/12-color-palette-generator\/","title":{"rendered":"12 Color Palette Generator"},"content":{"rendered":"\t\t<div data-elementor-type=\"container\" data-elementor-id=\"8310176\" class=\"elementor elementor-8310176\" data-elementor-post-type=\"elementor_library\">\n\t\t\t\t<div class=\"elementor-element elementor-element-23691a2c e-flex e-con-boxed e-con e-parent\" data-id=\"23691a2c\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-37c3711c elementor-widget elementor-widget-html\" data-id=\"37c3711c\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<style>\r\n    \/* --- Styles Adapted from Your Code --- *\/\r\n    .html-viewer-app {\r\n        width: 100%;\r\n        max-width: 1280px;\r\n        margin: 0 auto;\r\n        padding: 40px 15px; \/* Adjusted padding for this tool *\/\r\n        background: transparent;\r\n        font-family: sans-serif; \/* Added a fallback font *\/\r\n    }\r\n\r\n    .format-btn {\r\n        background-color: #000;\r\n        color: white;\r\n        border: none;\r\n        padding: 12px 24px;\r\n        cursor: pointer;\r\n        font-size: 1.125rem;\r\n        font-weight: 500;\r\n        transition: all 0.2s;\r\n        min-width: 11rem;\r\n        text-align: center;\r\n        border-radius: 4px; \/* Added for consistency *\/\r\n    }\r\n\r\n    .format-btn:is(:hover, :focus, :focus-visible, :active) {\r\n        background-color: #545454;\r\n    }\r\n\r\n    \/* Using your pink button style for the main action *\/\r\n    #generatePaletteBtn {\r\n        background-color: #ff7be5;\r\n        color: black;\r\n        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);\r\n    }\r\n\r\n    #generatePaletteBtn:is(:hover, :focus, :focus-visible, :active) {\r\n        background-color: #ffa8ee;\r\n    }\r\n\r\n    .copy-btn {\r\n        background-color: rgb(255, 255, 255);\r\n        color: black;\r\n        border: 1px solid #ddd;\r\n        padding: 6px 12px;\r\n        border-radius: 4px;\r\n        cursor: pointer;\r\n        font-size: 14px;\r\n        transition: background-color 0.2s;\r\n    }\r\n\r\n    .copy-btn:is(:hover, :focus, :focus-visible) {\r\n        background-color: #f6f6f6 !important;\r\n        color: black;\r\n    }\r\n\r\n    .success-message {\r\n        position: fixed;\r\n        top: 20px;\r\n        right: 20px;\r\n        background-color: #05047E; \/* Using your header color *\/\r\n        color: white;\r\n        padding: 12px 20px;\r\n        border-radius: 4px;\r\n        font-size: 14px;\r\n        opacity: 0;\r\n        transform: translateX(100%);\r\n        transition: all 0.3s ease;\r\n        z-index: 1000;\r\n        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);\r\n    }\r\n\r\n    .success-message.show {\r\n        opacity: 1;\r\n        transform: translateX(0);\r\n    }\r\n\r\n    \/* --- New Styles for the Palette Generator --- *\/\r\n    .palette-controls {\r\n        text-align: center;\r\n        margin-bottom: 40px;\r\n    }\r\n\r\n    .palette-grid {\r\n        display: grid;\r\n        \/* This makes the grid responsive automatically *\/\r\n        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));\r\n        gap: 25px;\r\n    }\r\n\r\n    .color-card {\r\n        background: white;\r\n        border: 1.5px solid #EBEBEB;\r\n        border-radius: 8px;\r\n        overflow: hidden;\r\n        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);\r\n        display: flex;\r\n        flex-direction: column;\r\n    }\r\n\r\n    .color-swatch {\r\n        height: 150px;\r\n        transition: background-color 0.3s ease;\r\n    }\r\n\r\n    .color-info {\r\n        padding: 15px;\r\n        display: flex;\r\n        justify-content: space-between;\r\n        align-items: center;\r\n        background-color: #ffffff;\r\n        border-top: 1.5px solid #EBEBEB;\r\n    }\r\n\r\n    .hex-code {\r\n        font-family: 'Courier New', monospace;\r\n        font-weight: 500;\r\n        font-size: 1rem;\r\n        color: #333;\r\n    }\r\n\r\n    \/* Responsive adjustments *\/\r\n    @media (max-width: 768px) {\r\n        .html-viewer-app {\r\n            padding-top: 20px;\r\n        }\r\n\r\n        .palette-grid {\r\n            grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));\r\n            gap: 15px;\r\n        }\r\n\r\n        .color-swatch {\r\n            height: 120px;\r\n        }\r\n    }\r\n<\/style>\r\n\r\n<div class=\"html-viewer-app\" id=\"palette-generator\">\r\n    \r\n    <div class=\"palette-controls\">\r\n        <button class=\"format-btn\" id=\"generatePaletteBtn\">Generate New Palette<\/button>\r\n    <\/div>\r\n\r\n    <div class=\"palette-grid\" id=\"paletteGrid\">\r\n        <!-- Color cards will be generated by JS and inserted here -->\r\n    <\/div>\r\n\r\n    <!-- Success message for copy action -->\r\n    <div class=\"success-message\" id=\"copySuccessMessage\">Color copied to clipboard!<\/div>\r\n\r\n<\/div>\r\n\r\n<script>\r\n    document.addEventListener('DOMContentLoaded', function() {\r\n        const generateBtn = document.getElementById('generatePaletteBtn');\r\n        const paletteGrid = document.getElementById('paletteGrid');\r\n        const copySuccessMessage = document.getElementById('copySuccessMessage');\r\n\r\n        \/**\r\n         * Generates a random hexadecimal color code.\r\n         * @returns {string} A random color string, e.g., \"#1a2b3c\".\r\n         *\/\r\n        const generateRandomColor = () => {\r\n            \/\/ Generate a random integer between 0 and 16777215 (FFFFFF in hex)\r\n            \/\/ Convert it to a hexadecimal string.\r\n            \/\/ Pad with leading zeros to ensure it's always 6 characters long.\r\n            const randomColor = '#' + Math.floor(Math.random() * 16777215).toString(16).padStart(6, '0');\r\n            return randomColor;\r\n        };\r\n\r\n        \/**\r\n         * Clears the grid and generates 12 new color cards.\r\n         *\/\r\n        const generatePalette = () => {\r\n            \/\/ Clear any existing colors\r\n            paletteGrid.innerHTML = '';\r\n\r\n            for (let i = 0; i < 12; i++) {\r\n                const color = generateRandomColor();\r\n\r\n                \/\/ Create a new div element for the color card\r\n                const colorCard = document.createElement('div');\r\n                colorCard.className = 'color-card';\r\n\r\n                \/\/ Set the inner HTML of the card with the color swatch and info\r\n                colorCard.innerHTML = `\r\n                    <div class=\"color-swatch\" style=\"background-color: ${color};\"><\/div>\r\n                    <div class=\"color-info\">\r\n                        <span class=\"hex-code\">${color.toUpperCase()}<\/span>\r\n                        <button class=\"copy-btn\" data-color=\"${color}\">Copy<\/button>\r\n                    <\/div>\r\n                `;\r\n\r\n                \/\/ Add the newly created card to the grid\r\n                paletteGrid.appendChild(colorCard);\r\n            }\r\n        };\r\n\r\n        \/**\r\n         * Handles click events on the palette grid for copying colors.\r\n         * This uses event delegation to avoid adding a listener to every button.\r\n         * @param {Event} e The click event.\r\n         *\/\r\n        const handleGridClick = (e) => {\r\n            \/\/ Check if the clicked element is a copy button\r\n            if (e.target.classList.contains('copy-btn')) {\r\n                const colorToCopy = e.target.dataset.color;\r\n\r\n                \/\/ Use the modern Navigator Clipboard API to copy text\r\n                navigator.clipboard.writeText(colorToCopy).then(() => {\r\n                    \/\/ On success, show the notification\r\n                    copySuccessMessage.classList.add('show');\r\n\r\n                    \/\/ Hide the notification after 2 seconds\r\n                    setTimeout(() => {\r\n                        copySuccessMessage.classList.remove('show');\r\n                    }, 2000);\r\n                }).catch(err => {\r\n                    console.error('Failed to copy color: ', err);\r\n                });\r\n            }\r\n        };\r\n\r\n        \/\/ --- Event Listeners ---\r\n\r\n        \/\/ Generate a new palette when the button is clicked\r\n        generateBtn.addEventListener('click', generatePalette);\r\n\r\n        \/\/ Listen for clicks on the entire grid to handle copy actions\r\n        paletteGrid.addEventListener('click', handleGridClick);\r\n\r\n        \/\/ --- Initial Load ---\r\n\r\n        \/\/ Generate a palette immediately when the page loads\r\n        generatePalette();\r\n    });\r\n<\/script>\r\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":5,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[22],"tags":[21],"class_list":["post-8310177","post","type-post","status-publish","format-standard","hentry","category-tools","tag-html-css-tools"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>12 Color Palette Generator<\/title>\n<meta name=\"description\" content=\"Generate beautiful and cohesive 12 color palettes for your website, branding, and design projects. Our intuitive 12 color palette generator makes color selection simple and effective.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/elementor.com\/tools\/12-color-palette-generator\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"12 Color Palette Generator\" \/>\n<meta property=\"og:description\" content=\"Generate beautiful and cohesive 12 color palettes for your website, branding, and design projects. Our intuitive 12 color palette generator makes color selection simple and effective.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/elementor.com\/tools\/12-color-palette-generator\/\" \/>\n<meta property=\"og:site_name\" content=\"Tools\" \/>\n<meta property=\"article:published_time\" content=\"2025-09-04T06:40:03+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-09-04T06:41:25+00:00\" \/>\n<meta name=\"author\" content=\"liz@148.red\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"liz@148.red\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/elementor.com\/tools\/12-color-palette-generator\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/elementor.com\/tools\/12-color-palette-generator\/\"},\"author\":{\"name\":\"liz@148.red\",\"@id\":\"https:\/\/elementor.com\/tools\/#\/schema\/person\/80e8375cb95e6030bc2f897c41c985ac\"},\"headline\":\"12 Color Palette Generator\",\"datePublished\":\"2025-09-04T06:40:03+00:00\",\"dateModified\":\"2025-09-04T06:41:25+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/elementor.com\/tools\/12-color-palette-generator\/\"},\"wordCount\":5,\"keywords\":[\"Html-Css-tools\"],\"articleSection\":[\"tools\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/elementor.com\/tools\/12-color-palette-generator\/\",\"url\":\"https:\/\/elementor.com\/tools\/12-color-palette-generator\/\",\"name\":\"12 Color Palette Generator\",\"isPartOf\":{\"@id\":\"https:\/\/elementor.com\/tools\/#website\"},\"datePublished\":\"2025-09-04T06:40:03+00:00\",\"dateModified\":\"2025-09-04T06:41:25+00:00\",\"author\":{\"@id\":\"https:\/\/elementor.com\/tools\/#\/schema\/person\/80e8375cb95e6030bc2f897c41c985ac\"},\"description\":\"Generate beautiful and cohesive 12 color palettes for your website, branding, and design projects. Our intuitive 12 color palette generator makes color selection simple and effective.\",\"breadcrumb\":{\"@id\":\"https:\/\/elementor.com\/tools\/12-color-palette-generator\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/elementor.com\/tools\/12-color-palette-generator\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/elementor.com\/tools\/12-color-palette-generator\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/elementor.com\/tools\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"12 Color Palette Generator\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/elementor.com\/tools\/#website\",\"url\":\"https:\/\/elementor.com\/tools\/\",\"name\":\"Tools\",\"description\":\"Just another Elementor hosted website ;)\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/elementor.com\/tools\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/elementor.com\/tools\/#\/schema\/person\/80e8375cb95e6030bc2f897c41c985ac\",\"name\":\"liz@148.red\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/63b900d3310bd1ed40162fb27f016e9920ae66fa5be07be5153344329ef7d9d2?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/63b900d3310bd1ed40162fb27f016e9920ae66fa5be07be5153344329ef7d9d2?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/63b900d3310bd1ed40162fb27f016e9920ae66fa5be07be5153344329ef7d9d2?s=96&d=mm&r=g\",\"caption\":\"liz@148.red\"},\"url\":\"https:\/\/elementor.com\/tools\/author\/liz148-red\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"12 Color Palette Generator","description":"Generate beautiful and cohesive 12 color palettes for your website, branding, and design projects. Our intuitive 12 color palette generator makes color selection simple and effective.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/elementor.com\/tools\/12-color-palette-generator\/","og_locale":"en_US","og_type":"article","og_title":"12 Color Palette Generator","og_description":"Generate beautiful and cohesive 12 color palettes for your website, branding, and design projects. Our intuitive 12 color palette generator makes color selection simple and effective.","og_url":"https:\/\/elementor.com\/tools\/12-color-palette-generator\/","og_site_name":"Tools","article_published_time":"2025-09-04T06:40:03+00:00","article_modified_time":"2025-09-04T06:41:25+00:00","author":"liz@148.red","twitter_card":"summary_large_image","twitter_misc":{"Written by":"liz@148.red","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/elementor.com\/tools\/12-color-palette-generator\/#article","isPartOf":{"@id":"https:\/\/elementor.com\/tools\/12-color-palette-generator\/"},"author":{"name":"liz@148.red","@id":"https:\/\/elementor.com\/tools\/#\/schema\/person\/80e8375cb95e6030bc2f897c41c985ac"},"headline":"12 Color Palette Generator","datePublished":"2025-09-04T06:40:03+00:00","dateModified":"2025-09-04T06:41:25+00:00","mainEntityOfPage":{"@id":"https:\/\/elementor.com\/tools\/12-color-palette-generator\/"},"wordCount":5,"keywords":["Html-Css-tools"],"articleSection":["tools"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/elementor.com\/tools\/12-color-palette-generator\/","url":"https:\/\/elementor.com\/tools\/12-color-palette-generator\/","name":"12 Color Palette Generator","isPartOf":{"@id":"https:\/\/elementor.com\/tools\/#website"},"datePublished":"2025-09-04T06:40:03+00:00","dateModified":"2025-09-04T06:41:25+00:00","author":{"@id":"https:\/\/elementor.com\/tools\/#\/schema\/person\/80e8375cb95e6030bc2f897c41c985ac"},"description":"Generate beautiful and cohesive 12 color palettes for your website, branding, and design projects. Our intuitive 12 color palette generator makes color selection simple and effective.","breadcrumb":{"@id":"https:\/\/elementor.com\/tools\/12-color-palette-generator\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/elementor.com\/tools\/12-color-palette-generator\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/elementor.com\/tools\/12-color-palette-generator\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/elementor.com\/tools\/"},{"@type":"ListItem","position":2,"name":"12 Color Palette Generator"}]},{"@type":"WebSite","@id":"https:\/\/elementor.com\/tools\/#website","url":"https:\/\/elementor.com\/tools\/","name":"Tools","description":"Just another Elementor hosted website ;)","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/elementor.com\/tools\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/elementor.com\/tools\/#\/schema\/person\/80e8375cb95e6030bc2f897c41c985ac","name":"liz@148.red","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/63b900d3310bd1ed40162fb27f016e9920ae66fa5be07be5153344329ef7d9d2?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/63b900d3310bd1ed40162fb27f016e9920ae66fa5be07be5153344329ef7d9d2?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/63b900d3310bd1ed40162fb27f016e9920ae66fa5be07be5153344329ef7d9d2?s=96&d=mm&r=g","caption":"liz@148.red"},"url":"https:\/\/elementor.com\/tools\/author\/liz148-red\/"}]}},"_links":{"self":[{"href":"https:\/\/elementor.com\/tools\/wp-json\/wp\/v2\/posts\/8310177","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/elementor.com\/tools\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/elementor.com\/tools\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/elementor.com\/tools\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/elementor.com\/tools\/wp-json\/wp\/v2\/comments?post=8310177"}],"version-history":[{"count":1,"href":"https:\/\/elementor.com\/tools\/wp-json\/wp\/v2\/posts\/8310177\/revisions"}],"predecessor-version":[{"id":8310180,"href":"https:\/\/elementor.com\/tools\/wp-json\/wp\/v2\/posts\/8310177\/revisions\/8310180"}],"wp:attachment":[{"href":"https:\/\/elementor.com\/tools\/wp-json\/wp\/v2\/media?parent=8310177"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/elementor.com\/tools\/wp-json\/wp\/v2\/categories?post=8310177"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/elementor.com\/tools\/wp-json\/wp\/v2\/tags?post=8310177"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}