Created
July 3, 2022 16:51
-
-
Save envomer/57cae0b6f566fafc5a91c3f77f687806 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const colors = { | |
| Slate50: '#f8fafc', | |
| Slate100: '#f1f5f9', | |
| Slate200: '#e2e8f0', | |
| Slate300: '#cbd5e1', | |
| Slate400: '#94a3b8', | |
| Slate500: '#64748b', | |
| Slate600: '#475569', | |
| Slate700: '#334155', | |
| Slate800: '#1e293b', | |
| Slate900: '#0f172a', | |
| Gray50: '#f9fafb', | |
| Gray100: '#f3f4f6', | |
| Gray200: '#e5e7eb', | |
| Gray300: '#d1d5db', | |
| Gray400: '#9ca3af', | |
| Gray500: '#6b7280', | |
| Gray600: '#4b5563', | |
| Gray700: '#374151', | |
| Gray800: '#1f2937', | |
| Gray900: '#111827', | |
| Zinc50: '#fafafa', | |
| Zinc100: '#f4f4f5', | |
| Zinc200: '#e4e4e7', | |
| Zinc300: '#d4d4d8', | |
| Zinc400: '#a1a1aa', | |
| Zinc500: '#71717a', | |
| Zinc600: '#52525b', | |
| Zinc700: '#3f3f46', | |
| Zinc800: '#27272a', | |
| Zinc900: '#18181b', | |
| Neutral50: '#fafafa', | |
| Neutral100: '#f5f5f5', | |
| Neutral200: '#e5e5e5', | |
| Neutral300: '#d4d4d4', | |
| Neutral400: '#a3a3a3', | |
| Neutral500: '#737373', | |
| Neutral600: '#525252', | |
| Neutral700: '#404040', | |
| Neutral800: '#262626', | |
| Neutral900: '#171717', | |
| Stone50: '#fafaf9', | |
| Stone100: '#f5f5f4', | |
| Stone200: '#e7e5e4', | |
| Stone300: '#d6d3d1', | |
| Stone400: '#a8a29e', | |
| Stone500: '#78716c', | |
| Stone600: '#57534e', | |
| Stone700: '#44403c', | |
| Stone800: '#292524', | |
| Stone900: '#1c1917', | |
| Red50: '#fef2f2', | |
| Red100: '#fee2e2', | |
| Red200: '#fecaca', | |
| Red300: '#fca5a5', | |
| Red400: '#f87171', | |
| Red500: '#ef4444', | |
| Red600: '#dc2626', | |
| Red700: '#b91c1c', | |
| Red800: '#991b1b', | |
| Red900: '#7f1d1d', | |
| Orange50: '#fff7ed', | |
| Orange100: '#ffedd5', | |
| Orange200: '#fed7aa', | |
| Orange300: '#fdba74', | |
| Orange400: '#fb923c', | |
| Orange500: '#f97316', | |
| Orange600: '#ea580c', | |
| Orange700: '#c2410c', | |
| Orange800: '#9a3412', | |
| Orange900: '#7c2d12', | |
| Amber50: '#fffbeb', | |
| Amber100: '#fef3c7', | |
| Amber200: '#fde68a', | |
| Amber300: '#fcd34d', | |
| Amber400: '#fbbf24', | |
| Amber500: '#f59e0b', | |
| Amber600: '#d97706', | |
| Amber700: '#b45309', | |
| Amber800: '#92400e', | |
| Amber900: '#78350f', | |
| Yellow50: '#fefce8', | |
| Yellow100: '#fef9c3', | |
| Yellow200: '#fef08a', | |
| Yellow300: '#fde047', | |
| Yellow400: '#facc15', | |
| Yellow500: '#eab308', | |
| Yellow600: '#ca8a04', | |
| Yellow700: '#a16207', | |
| Yellow800: '#854d0e', | |
| Yellow900: '#713f12', | |
| Lime50: '#f7fee7', | |
| Lime100: '#ecfccb', | |
| Lime200: '#d9f99d', | |
| Lime300: '#bef264', | |
| Lime400: '#a3e635', | |
| Lime500: '#84cc16', | |
| Lime600: '#65a30d', | |
| Lime700: '#4d7c0f', | |
| Lime800: '#3f6212', | |
| Lime900: '#365314', | |
| Green50: '#f0fdf4', | |
| Green100: '#dcfce7', | |
| Green200: '#bbf7d0', | |
| Green300: '#86efac', | |
| Green400: '#4ade80', | |
| Green500: '#22c55e', | |
| Green600: '#16a34a', | |
| Green700: '#15803d', | |
| Green800: '#166534', | |
| Green900: '#14532d', | |
| Emerald50: '#ecfdf5', | |
| Emerald100: '#d1fae5', | |
| Emerald200: '#a7f3d0', | |
| Emerald300: '#6ee7b7', | |
| Emerald400: '#34d399', | |
| Emerald500: '#10b981', | |
| Emerald600: '#059669', | |
| Emerald700: '#047857', | |
| Emerald800: '#065f46', | |
| Emerald900: '#064e3b', | |
| Teal50: '#f0fdfa', | |
| Teal100: '#ccfbf1', | |
| Teal200: '#99f6e4', | |
| Teal300: '#5eead4', | |
| Teal400: '#2dd4bf', | |
| Teal500: '#14b8a6', | |
| Teal600: '#0d9488', | |
| Teal700: '#0f766e', | |
| Teal800: '#115e59', | |
| Teal900: '#134e4a', | |
| Cyan50: '#ecfeff', | |
| Cyan100: '#cffafe', | |
| Cyan200: '#a5f3fc', | |
| Cyan300: '#67e8f9', | |
| Cyan400: '#22d3ee', | |
| Cyan500: '#06b6d4', | |
| Cyan600: '#0891b2', | |
| Cyan700: '#0e7490', | |
| Cyan800: '#155e75', | |
| Cyan900: '#164e63', | |
| Sky50: '#f0f9ff', | |
| Sky100: '#e0f2fe', | |
| Sky200: '#bae6fd', | |
| Sky300: '#7dd3fc', | |
| Sky400: '#38bdf8', | |
| Sky500: '#0ea5e9', | |
| Sky600: '#0284c7', | |
| Sky700: '#0369a1', | |
| Sky800: '#075985', | |
| Sky900: '#0c4a6e', | |
| Blue50: '#eff6ff', | |
| Blue100: '#dbeafe', | |
| Blue200: '#bfdbfe', | |
| Blue300: '#93c5fd', | |
| Blue400: '#60a5fa', | |
| Blue500: '#3b82f6', | |
| Blue600: '#2563eb', | |
| Blue700: '#1d4ed8', | |
| Blue800: '#1e40af', | |
| Blue900: '#1e3a8a', | |
| Indigo50: '#eef2ff', | |
| Indigo100: '#e0e7ff', | |
| Indigo200: '#c7d2fe', | |
| Indigo300: '#a5b4fc', | |
| Indigo400: '#818cf8', | |
| Indigo500: '#6366f1', | |
| Indigo600: '#4f46e5', | |
| Indigo700: '#4338ca', | |
| Indigo800: '#3730a3', | |
| Indigo900: '#312e81', | |
| Violet50: '#f5f3ff', | |
| Violet100: '#ede9fe', | |
| Violet200: '#ddd6fe', | |
| Violet300: '#c4b5fd', | |
| Violet400: '#a78bfa', | |
| Violet500: '#8b5cf6', | |
| Violet600: '#7c3aed', | |
| Violet700: '#6d28d9', | |
| Violet800: '#5b21b6', | |
| Violet900: '#4c1d95', | |
| Purple50: '#faf5ff', | |
| Purple100: '#f3e8ff', | |
| Purple200: '#e9d5ff', | |
| Purple300: '#d8b4fe', | |
| Purple400: '#c084fc', | |
| Purple500: '#a855f7', | |
| Purple600: '#9333ea', | |
| Purple700: '#7e22ce', | |
| Purple800: '#6b21a8', | |
| Purple900: '#581c87', | |
| Fuchsia50: '#fdf4ff', | |
| Fuchsia100: '#fae8ff', | |
| Fuchsia200: '#f5d0fe', | |
| Fuchsia300: '#f0abfc', | |
| Fuchsia400: '#e879f9', | |
| Fuchsia500: '#d946ef', | |
| Fuchsia600: '#c026d3', | |
| Fuchsia700: '#a21caf', | |
| Fuchsia800: '#86198f', | |
| Fuchsia900: '#701a75', | |
| Pink50: '#fdf2f8', | |
| Pink100: '#fce7f3', | |
| Pink200: '#fbcfe8', | |
| Pink300: '#f9a8d4', | |
| Pink400: '#f472b6', | |
| Pink500: '#ec4899', | |
| Pink600: '#db2777', | |
| Pink700: '#be185d', | |
| Pink800: '#9d174d', | |
| Pink900: '#831843', | |
| Rose50: '#fff1f2', | |
| Rose100: '#ffe4e6', | |
| Rose200: '#fecdd3', | |
| Rose300: '#fda4af', | |
| Rose400: '#fb7185', | |
| Rose500: '#f43f5e', | |
| Rose600: '#e11d48', | |
| Rose700: '#be123c', | |
| Rose800: '#9f1239', | |
| Rose900: '#881337', | |
| } | |
| function hexToRgbA(name,hex){ | |
| var c; | |
| if(/^#([A-Fa-f0-9]{3}){1,2}$/.test(hex)){ | |
| c= hex.substring(1).split(''); | |
| if(c.length== 3){ | |
| c= [c[0], c[0], c[1], c[1], c[2], c[2]]; | |
| } | |
| c= '0x'+c.join(''); | |
| return 'static Color '+name.toLowerCase()+' = const Color.fromRGBO(('+[(c>>16)&255, (c>>8)&255, c&255].join(',')+',1)'; | |
| } | |
| throw new Error('Bad Hex'); | |
| } | |
| for (var key in colors) { | |
| console.log(hexToRgbA(key, colors[key])) | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment