<!-- Color Picker From Image - WordPress Embeddable Version Copy everything below and paste into a WordPress HTML block or Custom HTML widget --> <style> /* Color Picker Styles */<br /> .cp-container {<br /> font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;<br /> max-width: 900px;<br /> margin: 0 auto;<br /> padding: 12px;<br /> line-height: 1.4;<br /> max-height: 680px;<br /> overflow: hidden;<br /> }<br /> .cp-container * {<br /> box-sizing: border-box;<br /> }<br /> .cp-header {<br /> text-align: center;<br /> margin-bottom: 12px;<br /> }<br /> .cp-header h1 {<br /> font-size: 2.5rem;<br /> font-weight: 700;<br /> color: #1a1a2e;<br /> margin: 0 0 4px 0;<br /> }<br /> .cp-header p {<br /> color: #6b7280;<br /> font-size: 0.85rem;<br /> margin: 0;<br /> }<br /> .cp-card {<br /> background: #ffffff;<br /> border-radius: 12px;<br /> padding: 16px;<br /> box-shadow: 0 2px 8px -2px rgba(0,0,0,0.08), 0 4px 16px -4px rgba(0,0,0,0.12);<br /> border: 1px solid #e5e7eb;<br /> margin-bottom: 12px;<br /> }<br /> /* Upload Zone */<br /> .cp-upload-zone {<br /> border: 2px dashed #d1d5db;<br /> border-radius: 10px;<br /> padding: 30px 16px;<br /> text-align: center;<br /> cursor: pointer;<br /> transition: all 0.2s ease;<br /> background: #fafafa;<br /> }<br /> .cp-upload-zone:hover,<br /> .cp-upload-zone.dragging {<br /> border-color: #0d9488;<br /> background: #f0fdfa;<br /> }<br /> .cp-upload-icon {<br /> width: 40px;<br /> height: 40px;<br /> margin: 0 auto 12px;<br /> background: #e0f2f1;<br /> border-radius: 50%;<br /> display: flex;<br /> align-items: center;<br /> justify-content: center;<br /> color: #0d9488;<br /> }<br /> .cp-upload-zone h3 {<br /> font-size: 1rem;<br /> font-weight: 600;<br /> margin: 0 0 4px 0;<br /> color: #1a1a2e;<br /> }<br /> .cp-upload-zone p {<br /> color: #6b7280;<br /> font-size: 0.8rem;<br /> margin: 2px 0;<br /> }<br /> .cp-upload-zone input[type="file"] {<br /> display: none;<br /> }<br /> /* URL Input */<br /> .cp-url-row {<br /> display: flex;<br /> gap: 8px;<br /> margin-top: 12px;<br /> }<br /> .cp-url-input {<br /> flex: 1;<br /> padding: 8px 12px;<br /> border: 1px solid #d1d5db;<br /> border-radius: 6px;<br /> font-size: 0.8rem;<br /> outline: none;<br /> transition: border-color 0.2s;<br /> }<br /> .cp-url-input:focus {<br /> border-color: #0d9488;<br /> }<br /> .cp-btn {<br /> padding: 8px 14px;<br /> border: none;<br /> border-radius: 6px;<br /> font-size: 0.8rem;<br /> font-weight: 500;<br /> cursor: pointer;<br /> transition: all 0.2s;<br /> display: inline-flex;<br /> align-items: center;<br /> gap: 5px;<br /> }<br /> .cp-btn-primary {<br /> background: linear-gradient(135deg, #0d9488, #14b8a6);<br /> color: white;<br /> }<br /> .cp-btn-primary:hover {<br /> transform: scale(1.02);<br /> box-shadow: 0 0 20px rgba(13, 148, 136, 0.3);<br /> }<br /> .cp-btn-secondary {<br /> background: #f3f4f6;<br /> color: #374151;<br /> border: 1px solid #e5e7eb;<br /> }<br /> .cp-btn-secondary:hover {<br /> background: #e5e7eb;<br /> }<br /> /* Main Layout - Side by side */<br /> .cp-main-layout {<br /> display: grid;<br /> grid-template-columns: 1fr 280px;<br /> gap: 16px;<br /> margin-bottom: 12px;<br /> }<br /> /* Canvas Container */<br /> .cp-canvas-section {<br /> background: #ffffff;<br /> border-radius: 12px;<br /> padding: 12px;<br /> box-shadow: 0 2px 8px -2px rgba(0,0,0,0.08), 0 4px 16px -4px rgba(0,0,0,0.12);<br /> border: 1px solid #e5e7eb;<br /> }<br /> .cp-canvas-container {<br /> position: relative;<br /> display: inline-block;<br /> border-radius: 8px;<br /> overflow: hidden;<br /> box-shadow: 0 2px 8px rgba(0,0,0,0.1);<br /> }<br /> .cp-canvas-container canvas {<br /> display: block;<br /> cursor: crosshair;<br /> max-height: 280px;<br /> width: auto;<br /> }<br /> .cp-canvas-wrapper {<br /> text-align: center;<br /> }<br /> .cp-canvas-hint {<br /> color: #6b7280;<br /> font-size: 0.75rem;<br /> margin-top: 8px;<br /> margin-bottom: 0;<br /> }<br /> /* Magnifier */<br /> .cp-magnifier {<br /> position: absolute;<br /> width: 100px;<br /> height: 100px;<br /> border-radius: 50%;<br /> border: 3px solid white;<br /> box-shadow: 0 4px 12px rgba(0,0,0,0.2);<br /> pointer-events: none;<br /> display: none;<br /> overflow: hidden;<br /> }<br /> .cp-magnifier canvas {<br /> border-radius: 50%;<br /> }<br /> .cp-magnifier-color {<br /> position: absolute;<br /> bottom: -24px;<br /> left: 50%;<br /> transform: translateX(-50%);<br /> padding: 3px 6px;<br /> border-radius: 4px;<br /> font-size: 10px;<br /> font-family: monospace;<br /> white-space: nowrap;<br /> }<br /> /* Controls */<br /> .cp-controls {<br /> display: flex;<br /> flex-wrap: wrap;<br /> align-items: center;<br /> justify-content: space-between;<br /> gap: 10px;<br /> margin-bottom: 12px;<br /> }<br /> .cp-palette-size {<br /> display: flex;<br /> align-items: center;<br /> gap: 6px;<br /> }<br /> .cp-palette-size span {<br /> color: #6b7280;<br /> font-size: 0.75rem;<br /> }<br /> .cp-size-btn {<br /> width: 28px;<br /> height: 28px;<br /> border: none;<br /> border-radius: 6px;<br /> background: #f3f4f6;<br /> color: #6b7280;<br /> font-weight: 500;<br /> font-size: 0.75rem;<br /> cursor: pointer;<br /> transition: all 0.2s;<br /> }<br /> .cp-size-btn.active {<br /> background: #0d9488;<br /> color: white;<br /> }<br /> .cp-size-btn:hover:not(.active) {<br /> background: #e5e7eb;<br /> }<br /> /* Selected Color Display - Compact for sidebar */<br /> .cp-selected-section {<br /> background: #ffffff;<br /> border-radius: 12px;<br /> padding: 14px;<br /> box-shadow: 0 2px 8px -2px rgba(0,0,0,0.08), 0 4px 16px -4px rgba(0,0,0,0.12);<br /> border: 1px solid #e5e7eb;<br /> display: flex;<br /> flex-direction: column;<br /> }<br /> .cp-selected-color h3 {<br /> font-size: 0.8rem;<br /> font-weight: 500;<br /> color: #6b7280;<br /> margin: 0 0 10px 0;<br /> }<br /> .cp-color-preview {<br /> width: 100%;<br /> height: 80px;<br /> border-radius: 10px;<br /> box-shadow: 0 2px 8px rgba(0,0,0,0.1);<br /> margin-bottom: 12px;<br /> }<br /> .cp-color-values {<br /> flex: 1;<br /> }<br /> .cp-format-tabs {<br /> display: flex;<br /> background: #f3f4f6;<br /> border-radius: 6px;<br /> padding: 3px;<br /> margin-bottom: 10px;<br /> }<br /> .cp-format-tab {<br /> flex: 1;<br /> padding: 6px;<br /> border: none;<br /> background: transparent;<br /> font-size: 0.7rem;<br /> font-weight: 500;<br /> color: #6b7280;<br /> cursor: pointer;<br /> border-radius: 4px;<br /> transition: all 0.2s;<br /> }<br /> .cp-format-tab.active {<br /> background: white;<br /> color: #1a1a2e;<br /> box-shadow: 0 1px 3px rgba(0,0,0,0.1);<br /> }<br /> .cp-value-display {<br /> display: flex;<br /> gap: 6px;<br /> }<br /> .cp-value-input {<br /> flex: 1;<br /> padding: 10px 12px;<br /> background: #f3f4f6;<br /> border: none;<br /> border-radius: 6px;<br /> font-family: monospace;<br /> font-size: 0.8rem;<br /> color: #1a1a2e;<br /> }<br /> .cp-rgb-values {<br /> display: grid;<br /> grid-template-columns: repeat(3, 1fr);<br /> gap: 6px;<br /> margin-top: 8px;<br /> }<br /> .cp-rgb-box {<br /> padding: 6px;<br /> background: #f9fafb;<br /> border-radius: 6px;<br /> font-size: 0.7rem;<br /> text-align: center;<br /> }<br /> .cp-rgb-box span:first-child {<br /> color: #6b7280;<br /> }<br /> .cp-rgb-box span:last-child {<br /> font-family: monospace;<br /> margin-left: 2px;<br /> }<br /> /* Palette - Below main content */<br /> .cp-palette-card {<br /> background: #ffffff;<br /> border-radius: 12px;<br /> padding: 14px;<br /> box-shadow: 0 2px 8px -2px rgba(0,0,0,0.08), 0 4px 16px -4px rgba(0,0,0,0.12);<br /> border: 1px solid #e5e7eb;<br /> }<br /> .cp-palette-header {<br /> display: flex;<br /> justify-content: space-between;<br /> align-items: center;<br /> margin-bottom: 10px;<br /> }<br /> .cp-palette h3 {<br /> font-size: 0.8rem;<br /> font-weight: 500;<br /> color: #6b7280;<br /> margin: 0;<br /> }<br /> .cp-palette-grid {<br /> display: flex;<br /> gap: 8px;<br /> flex-wrap: wrap;<br /> }<br /> .cp-color-swatch {<br /> position: relative;<br /> width: 50px;<br /> height: 50px;<br /> border-radius: 10px;<br /> overflow: hidden;<br /> cursor: pointer;<br /> transition: transform 0.2s, box-shadow 0.2s;<br /> flex-shrink: 0;<br /> }<br /> .cp-color-swatch:hover {<br /> transform: scale(1.08);<br /> box-shadow: 0 4px 12px rgba(0,0,0,0.15);<br /> }<br /> .cp-color-swatch.selected {<br /> outline: 3px solid #0d9488;<br /> outline-offset: 2px;<br /> }<br /> .cp-color-swatch-inner {<br /> width: 100%;<br /> height: 100%;<br /> }<br /> .cp-color-swatch-overlay {<br /> position: absolute;<br /> inset: 0;<br /> display: flex;<br /> align-items: center;<br /> justify-content: center;<br /> background: rgba(0,0,0,0.2);<br /> opacity: 0;<br /> transition: opacity 0.2s;<br /> }<br /> .cp-color-swatch:hover .cp-color-swatch-overlay {<br /> opacity: 1;<br /> }<br /> .cp-copy-btn {<br /> width: 24px;<br /> height: 24px;<br /> border-radius: 50%;<br /> background: rgba(255,255,255,0.9);<br /> border: none;<br /> cursor: pointer;<br /> display: flex;<br /> align-items: center;<br /> justify-content: center;<br /> }<br /> .cp-color-swatch-hex {<br /> position: absolute;<br /> bottom: 0;<br /> left: 0;<br /> right: 0;<br /> padding: 4px;<br /> background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);<br /> color: white;<br /> font-size: 8px;<br /> font-family: monospace;<br /> text-align: center;<br /> }<br /> /* Export Section */<br /> .cp-export {<br /> display: flex;<br /> align-items: center;<br /> gap: 8px;<br /> margin-top: 10px;<br /> padding-top: 10px;<br /> border-top: 1px solid #e5e7eb;<br /> }<br /> .cp-export h3 {<br /> font-size: 0.75rem;<br /> font-weight: 500;<br /> color: #6b7280;<br /> margin: 0;<br /> white-space: nowrap;<br /> }<br /> .cp-export-btns {<br /> display: flex;<br /> flex-wrap: wrap;<br /> gap: 6px;<br /> }<br /> .cp-export-btns .cp-btn {<br /> padding: 6px 10px;<br /> font-size: 0.7rem;<br /> }<br /> /* Toast */<br /> .cp-toast {<br /> position: fixed;<br /> bottom: 20px;<br /> left: 50%;<br /> transform: translateX(-50%) translateY(100px);<br /> background: #1a1a2e;<br /> color: white;<br /> padding: 10px 20px;<br /> border-radius: 6px;<br /> font-size: 0.8rem;<br /> opacity: 0;<br /> transition: all 0.3s ease;<br /> z-index: 1000;<br /> }<br /> .cp-toast.show {<br /> transform: translateX(-50%) translateY(0);<br /> opacity: 1;<br /> }<br /> /* Hidden */<br /> .cp-hidden {<br /> display: none !important;<br /> }<br /> /* Responsive */<br /> @media (max-width: 700px) {<br /> .cp-container {<br /> padding: 10px;<br /> max-height: none;<br /> }<br /> .cp-main-layout {<br /> grid-template-columns: 1fr;<br /> }<br /> .cp-controls {<br /> flex-direction: column;<br /> align-items: stretch;<br /> }<br /> .cp-palette-grid {<br /> justify-content: center;<br /> }<br /> ol.newol {<br /> list-style:auto!important;<br /> padding-left: 40px!important;<br /> margin-bottom: 20px!important;<br /> }<br /> ul.newul {<br /> list-style: square!important;<br /> padding-left: 40px!important;<br /> margin-bottom: 20px!important;<br /> }<br /> .elementor-widget-text-editor p {<br /> color: #0b0715 !important;<br /> }<br /> }<br /></style> <header> <h1>Photo to Color Palette</h1> Upload a photo to extract beautiful color palettes. Click anywhere to pick colors. </header><!-- Upload Section --> <h3>Drop your image here</h3> or click to browse • Paste from clipboard (Ctrl+V) <p style="font-size: 11px; margin-top: 6px;">Supports JPG, PNG, GIF, WebP • Max 10MB</p> <input id="cpFileInput" accept="image/jpeg,image/png,image/gif,image/webp" type="file" /> <input id="cpUrlInput" type="url" placeholder="Paste image URL..." /> <button id="cpLoadUrlBtn"></button> Load <!-- Main Layout: Image + Selected Color Side by Side --> <!-- Left: Image Canvas --> Colors: <button data-count="5">5</button> <button data-count="6">6</button> <button data-count="8">8</button> <button data-count="10">10</button> <button data-count="12">12</button> <button id="cpRegenerateBtn"></button> Regenerate Try your image <canvas id="cpCanvas"></canvas> <canvas id="cpMagCanvas" width="100" height="100"></canvas> Click anywhere on the image to pick a color <!-- Right: Selected Color --> <h3>Selected Color</h3> <button data-format="hex">HEX</button> <button data-format="rgb">RGB</button> <button data-format="hsl">HSL</button> <input id="cpColorValue" readonly="readonly" type="text" /> <button id="cpCopyValueBtn"></button> R:0 G:0 B:0 <!-- Palette Section Below --> <h3>Generated Palette</h3> <h3>Export:</h3> <button id="cpExportPng">PNG</button> <button id="cpExportSvg">SVG</button> <button id="cpExportCss">CSS</button> <button id="cpExportScss">SCSS</button> <button id="cpExportJson">JSON</button> <!-- Toast -->