An open API service indexing awesome lists of open source software.

https://github.com/rembertdesigns/gradient-background-picker

🔴🟠🟡🟢🔵🟣 Gradient Picker allows you to make combinations of colors for websites, apps, etc..
https://github.com/rembertdesigns/gradient-background-picker

color-picker css-animations html-css-javascript javascript-applications

Last synced: 8 months ago
JSON representation

🔴🟠🟡🟢🔵🟣 Gradient Picker allows you to make combinations of colors for websites, apps, etc..

Awesome Lists containing this project

README

          

# 🎨 Advanced Gradient Generator

A powerful, feature-rich gradient generator that lets you create beautiful animated multi-color gradients for your web projects. Built with vanilla JavaScript, this tool offers professional-grade features including animations, advanced color picker, gradient library management, and multiple export formats.

## 📸 Screenshots

![Main Interface](https://via.placeholder.com/800x500/667eea/ffffff?text=Gradient+Generator+Interface)
*Main gradient generator interface with animation controls and live preview*

![Advanced Color Picker](https://via.placeholder.com/600x400/764ba2/ffffff?text=Advanced+Color+Picker)
*Advanced color picker with HSL controls, harmony generator, and eyedropper tool*

## 📋 Table of Contents

- [✨ Features](#-features)
- [🚀 Getting Started](#-getting-started)
- [🎮 How to Use](#-how-to-use)
- [🏗️ Project Structure](#️-project-structure)
- [🎯 Use Cases](#-use-cases)
- [🔧 Customization](#-customization)
- [🌐 Browser Support](#-browser-support)
- [❓ FAQ & Troubleshooting](#-faq--troubleshooting)
- [🗺️ Roadmap](#️-roadmap)
- [🤝 Contributing](#-contributing)
- [📜 License](#-license)

## ✨ Features

### 🎬 Animation System
- **Multiple Animation Types**: Rotate, Shift, Pulse, and Static options
- **Speed Control**: Adjustable animation speed from 0.5x to 5x
- **Direction Control**: Forward and reverse animations
- **Real-time Preview**: See animations as you create them
- **Timeline Editor**: Advanced keyframe-based animation system with custom easing functions

### 🎨 Advanced Color Management
- **Unlimited Color Stops**: Add as many gradient stops as needed
- **Advanced Color Picker**: HSL sliders, RGB inputs, hex values
- **Color Harmony Generator**: Complementary, triadic, analogous, and monochromatic schemes
- **Eyedropper Tool**: Pick colors directly from your screen (supported browsers)
- **Recent Colors**: Automatic tracking of recently used colors
- **Color Palette Extraction**: Extract colors from images or websites

### 🎭 Pattern & Texture Overlays
- **Pattern Types**: Noise, stripes, dots, waves, and more
- **Advanced Textures**: Paper, canvas, fabric, metal, glass, concrete, and wood
- **Custom Uploads**: Upload your own textures and SVG patterns
- **Procedural Patterns**: Perlin noise, Voronoi, fractal, and cellular patterns
- **Blend Modes**: 12+ blend modes including multiply, screen, overlay, and soft-light

### 🕸️ Mesh Gradient Mode
- **Interactive Mesh Grid**: Create complex multi-point gradients
- **Grid Sizes**: 2×2, 3×3, and 4×4 configurations
- **Click-to-Edit**: Easy color selection for each mesh point
- **Randomization**: Instant creative variations

### 🎭 Gradient Masks
- **Shape Masks**: Circle, ellipse, polygon, heart, and star
- **Custom SVG Paths**: Define your own mask shapes
- **Edge Blur Control**: Smooth mask edges
- **Size Adjustment**: Scale masks to fit your needs

### 🗂️ Gradient Library
- **Favorites System**: Save and organize your best gradients
- **Collections**: Group gradients by project or theme
- **Search & Filter**: Find gradients quickly with tags and names
- **Import/Export**: Share gradient libraries with others
- **12 Built-in Presets**: Professional gradient starting points
- **Community Feed**: Browse trending and popular gradients

### 🤖 AI-Powered Features
- **Similar Gradients**: Generate variations of your current gradient
- **Mood-Based Suggestions**: 10+ mood categories from energetic to futuristic
- **Brand Palette Generator**: Create cohesive color schemes from a single brand color
- **Seasonal Trends**: Explore gradients for spring, summer, autumn, winter, and design trends

### 🎨 Advanced Gradient Combinations
- **Layer Multiple Gradients**: Stack gradients with different blend modes
- **Mix Two Gradients**: Blend between two gradients with adjustable ratio
- **Morph Animation**: Generate smooth transitions between gradients
- **Split-Screen Compare**: Side-by-side gradient comparison

### 🖱️ Interactive Canvas
- **Visual Editing**: Click and drag to reposition color stops
- **Double-Click Add**: Add new stops anywhere on the canvas
- **Right-Click Remove**: Remove stops with context menu
- **Bezier Curves**: Create smooth color transitions
- **Gradient Warping**: Enable advanced gradient distortion

### ♿ Accessibility Features
- **Contrast Checker**: WCAG AA/AAA compliance testing
- **Color Blindness Simulation**: 8+ types including protanopia, deuteranopia, and tritanopia
- **Readability Score**: Real-time text readability analysis
- **WCAG Compliance Report**: Comprehensive accessibility audit

### ⚡ Performance Optimization
- **CSS Complexity Analysis**: Track code efficiency
- **Performance Impact Score**: Measure rendering performance
- **File Size Estimation**: Know before you export
- **Browser Compatibility**: Check support across Chrome, Firefox, Safari, and Edge
- **Auto-Optimization**: Generate optimized CSS and fallbacks

### 🔧 Professional Tools
- **Multiple Gradient Types**: Linear, radial, and conic gradients
- **Full Control**: Adjust angles, positions, and color stops precisely
- **Live Demos**: See how gradients look on cards, buttons, and text
- **Share URLs**: Generate shareable links with all gradient settings
- **QR Code Generation**: Quick mobile sharing
- **Embed Code**: Integrate gradients into websites

### 📤 Export Options
- **CSS**: Standard CSS with animation keyframes
- **Tailwind**: Tailwind CSS classes and utilities
- **React**: JSX-ready style objects
- **SCSS**: Variables and mixins for Sass projects
- **Vue**: Vue.js code
- **Svelte**: Svelte component code
- **Angular**: Angular template syntax
- **Flutter**: Dart gradient code
- **SwiftUI**: Swift gradient declarations
- **Styled Components**: CSS-in-JS format
- **Emotion**: Emotion CSS syntax
- **CSS Variables**: Custom properties format
- **PNG/SVG Downloads**: High-quality image exports (Full HD, 2K, 4K)
- **GIF/MP4**: Animated gradient exports

### 🤝 Collaboration & Sharing
- **Social Media Previews**: Generate cards for Twitter and Facebook
- **Platform Sharing**: Direct sharing to Dribbble, Behance, Twitter, and Pinterest
- **WordPress & Shopify**: Export format-specific code snippets
- **Figma & Sketch**: Design tool integration formats

### 🎓 Learning & Onboarding
- **Interactive Tutorial**: Step-by-step guided tour
- **Keyboard Shortcuts**: Efficient workflow with hotkeys
- **Context Help**: Tooltips and inline guidance
- **Video Export**: Create gradient animation videos

## 🚀 Getting Started

### Quick Start
1. **Clone the repository**
```bash
git clone https://github.com/rembertdesigns/gradient-generator.git
cd gradient-generator
```
2. **Open in browser**
```bash
# Simply open index.html in your browser
open index.html
# or
python -m http.server 8000 # For local development server
```
3. **Start creating!**
- Adjust color stops by clicking on color inputs
- Change gradient type and angle
- Add animations and export your creation

### No Build Process Required
This project uses vanilla JavaScript, HTML, and CSS - no complex build tools or dependencies needed!

## 🎮 How to Use

### Creating Your First Gradient
1. **Choose Colors**: Click on color stops to open the advanced color picker
2. **Adjust Positions**: Drag the position sliders to move color stops
3. **Set Type & Angle**: Choose linear, radial, or conic gradients
4. **Add Animation**: Select rotation, shift, or pulse effects
5. **Export**: Copy CSS, download images, or save to favorites

### Advanced Features

#### Pattern & Texture Overlays
1. Navigate to the "Pattern & Effects" section
2. Select a pattern type (noise, stripes, dots, waves)
3. Adjust intensity and scale sliders
4. Choose blend modes for unique effects
5. Upload custom textures for personalized looks

#### Mesh Gradient Mode
1. Enable mesh mode with the toggle switch
2. Select grid size (2×2, 3×3, or 4×4)
3. Click on grid points to change colors
4. Use randomize for instant variations
5. Reset to start fresh

#### Interactive Canvas Editing
1. Enable interactive mode on the canvas
2. Click and drag color stops to reposition
3. Double-click to add new stops
4. Right-click stops to remove them
5. Adjust bezier intensity for smooth transitions

#### Timeline Animation Editor
1. Add keyframes at different time points
2. Set gradient appearance for each keyframe
3. Choose easing functions (linear, ease, bounce, etc.)
4. Play/pause to preview animation
5. Export as CSS keyframes or video

#### AI-Powered Suggestions
1. Go to "AI-Powered Suggestions" section
2. Generate similar gradients with variation control
3. Explore mood-based gradients (energetic, calm, romantic, etc.)
4. Create brand palettes from a single color
5. Discover seasonal and trending gradients

#### Accessibility Testing
1. Open "Accessibility Checker" section
2. Test contrast ratios with different text colors
3. Simulate 8+ types of color blindness
4. Review WCAG compliance report
5. Get suggestions for improvements

#### Color Palette Extraction
1. Upload an image or enter a website URL
2. Extract color palette automatically
3. Apply extracted colors to your gradient
4. Save palettes for later use

## 🏗️ Project Structure
```bash
gradient-generator/
├── index.html # Main HTML structure with all features
├── style.css # Complete styling and animations
├── main.js # Core application logic
└── README.md # This file
```
### Architecture Highlights
- **Class-based JavaScript**: Clean, maintainable code structure
- **CSS Grid & Flexbox**: Responsive, modern layouts
- **Local Storage**: Persistent favorites and settings
- **Modular Design**: Easy to extend and customize
- **Canvas API**: Advanced pattern generation and export
- **Web APIs**: EyeDropper, FileReader, and more

## 🎯 Use Cases

### For Developers
- **Rapid Prototyping**: Quickly generate gradients for mockups
- **Production Ready**: Export clean, optimized CSS
- **Framework Integration**: Support for React, Vue, Angular, Flutter, SwiftUI, and more
- **Design Systems**: Consistent gradient libraries across projects
- **Accessibility Testing**: Ensure WCAG compliance
- **Performance Optimization**: Analyze and optimize gradient complexity

### For Designers
- **Visual Exploration**: Real-time gradient experimentation
- **Color Harmony**: Built-in color theory tools
- **Asset Generation**: High-quality PNG/SVG/GIF/MP4 exports
- **Collaboration**: Shareable gradient collections
- **Mesh Gradients**: Create complex multi-point gradients
- **Brand Identity**: Generate cohesive color palettes

### For Content Creators
- **Social Media Assets**: Export optimized cards for platforms
- **Video Backgrounds**: Generate animated gradient videos
- **Website Embeds**: Easy integration code
- **QR Codes**: Mobile-friendly sharing

## 🔧 Customization

### Adding New Animation Types
```javascript
// In main.js, extend the animation system
updateAnimation() {
// Add your custom animation logic here
if (this.animationType === 'your-animation') {
// Custom animation implementation
}
}
```
### Custom Color Presets
```javascript
// Add to the presets array in loadPresets()
const customPresets = [
{ name: 'Your Brand', gradient: 'linear-gradient(45deg, #yourcolor1, #yourcolor2)' },
// Add more presets
];
```
### Adding New Patterns
```javascript
// In the pattern generation section
generatePattern(type) {
switch(type) {
case 'your-pattern':
// Custom pattern generation logic
break;
}
}
```
### Theming
Modify CSS custom properties in `style.css`:
```javascript
:root {
--primary-color: #667eea;
--secondary-color: #764ba2;
--background-blur: 10px;
/* Customize colors and effects */
}
```
## 🌐 Browser Support

- **Chrome/Edge**: Full support including eyedropper tool
- **Firefox**: Full support (eyedropper coming soon)
- **Safari**: Full support with minor animation differences
- **Mobile**: Responsive design works on all devices

### Feature Support by Browser
| Feature | Chrome | Firefox | Safari | Edge |
|---------|--------|---------|--------|------|
| Basic Gradients | ✅ | ✅ | ✅ | ✅ |
| Animations | ✅ | ✅ | ✅ | ✅ |
| Eyedropper | ✅ | ⏳ | ⏳ | ✅ |
| Canvas Export | ✅ | ✅ | ✅ | ✅ |
| Mesh Gradients | ✅ | ✅ | ✅ | ✅ |
| Timeline Editor | ✅ | ✅ | ✅ | ✅ |

## 📱 Responsive Design

The generator is fully responsive and works beautifully on:
- **Desktop**: Full-featured experience with all tools
- **Tablet**: Optimized layout with touch-friendly controls
- **Mobile**: Streamlined interface with essential features

## ❓ FAQ & Troubleshooting

### Common Issues

**Q: Animations aren't working on my browser**
A: Animations use CSS transforms and may have limited support on older browsers. Try updating your browser or disabling hardware acceleration if you experience performance issues.

**Q: Eyedropper tool says "not supported"**
A: The EyeDropper API is currently supported in Chrome/Edge 95+. Firefox and Safari support is coming soon. You can still manually enter color values.

**Q: My gradients look different when exported**
A: Some complex gradients with many color stops might render differently across browsers. Test your exported CSS in your target browsers for consistency.

**Q: Local storage data is gone**
A: Favorites and collections are stored in browser local storage. Clear browser data or incognito mode will reset these. Use the export feature to backup your gradients.

**Q: Can I use this for commercial projects?**
A: Yes! This project is MIT licensed, so you can use generated gradients in any project, commercial or personal.

**Q: How do I use the mesh gradient feature?**
A: Enable mesh mode in the Mesh Gradient section, select your grid size, and click on grid points to change colors. You can also randomize for quick variations.

**Q: Can I extract colors from images?**
A: Yes! Use the Color Palette Extraction section to upload images or enter website URLs. The tool will automatically extract the dominant colors.

**Q: How do I test if my gradient is accessible?**
A: Use the Accessibility Checker section to test contrast ratios, simulate color blindness, and get WCAG compliance reports with improvement suggestions.

### Performance Tips
- Limit animations on mobile devices for better battery life
- Use fewer color stops for smoother gradients
- Export static CSS for production instead of keeping animations
- Test performance impact score before using complex patterns
- Generate optimized CSS for better rendering

### Keyboard Shortcuts

- **Ctrl/Cmd + S**: Save to Favorites
- **Ctrl/Cmd + C**: Copy CSS
- **Ctrl/Cmd + Z**: Undo
- **Ctrl/Cmd + Y**: Redo
- **Alt + R**: Random Gradient
- **Alt + D**: Toggle Dark Mode
- **Space**: Play/Pause Animation
- **?**: Show Keyboard Shortcuts

## 🗺️ Roadmap

### Recently Added ✅
- [x] **Mesh Gradient Mode**: Multi-point gradient system with interactive grid
- [x] **Advanced Patterns & Textures**: 7+ texture types with custom upload support
- [x] **Timeline Animation Editor**: Keyframe-based animations with custom easing
- [x] **Accessibility Suite**: Contrast checker, color blindness simulation, WCAG compliance
- [x] **AI-Powered Suggestions**: Similar gradients, mood-based, brand palettes, seasonal trends
- [x] **Color Palette Extraction**: From images and websites
- [x] **Gradient Combinations**: Layer, mix, morph, and compare modes
- [x] **Interactive Canvas**: Visual gradient editing with bezier curves
- [x] **Gradient Masks**: Shape masks with custom SVG support
- [x] **Performance Tools**: Optimization analysis and browser compatibility
- [x] **Extended Export Options**: 13+ format including Flutter, SwiftUI, and video
- [x] **Collaboration Features**: QR codes, embeds, social media cards
- [x] **Community Feed**: Browse trending gradients
- [x] **Tutorial System**: Interactive onboarding

### Near Term (Next Release)
- [ ] **3D Gradient Preview**: WebGL-powered 3D visualization
- [ ] **Gradient Animation Presets**: Pre-built animation templates
- [ ] **Collaborative Editing**: Real-time multi-user editing
- [ ] **Version History**: Track gradient changes over time
- [ ] **Custom Easing Curves**: Visual bezier curve editor
- [ ] **Gradient Interpolation**: Smart color mixing algorithms

### Medium Term (Next 3 Months)
- [ ] **AI Color Naming**: Automatic gradient name generation
- [ ] **Advanced Morphing**: Multi-gradient transition sequences
- [ ] **Design System Integration**: Figma/Sketch plugin support
- [ ] **Mobile App**: Progressive Web App with offline support
- [ ] **Team Workspaces**: Organization-level gradient libraries
- [ ] **API Access**: Programmatic gradient generation

### Long Term (6+ Months)
- [ ] **Machine Learning**: Smart gradient recommendations based on usage
- [ ] **3D Mesh Gradients**: Volumetric gradient rendering
- [ ] **AR Preview**: See gradients in augmented reality
- [ ] **Cloud Sync**: Cross-device gradient synchronization
- [ ] **Marketplace**: Share and sell gradient packs
- [ ] **Integration SDK**: Embed generator in other applications

### Community Requested
- [ ] **Gradient to Code**: Reverse engineer gradients from images
- [ ] **Batch Processing**: Generate multiple gradient variations
- [ ] **Color Spaces**: Support for LAB, LCH, and other color spaces
- [ ] **Gradient Blending Modes**: Advanced mixing techniques
- [ ] **Print Optimization**: CMYK export for print design

*Have an idea? [Open an issue](../../issues) or contribute to the discussion!*

## 🤝 Contributing

We welcome contributions! Please read our [Contributing Guidelines](CONTRIBUTING.md) and [Code of Conduct](CODE_OF_CONDUCT.md) before getting started.

### Quick Start for Contributors
1. **Fork the repository**
2. **Create a feature branch**: `git checkout -b feature/amazing-feature`
3. **Commit changes**: `git commit -m 'Add amazing feature'`
4. **Push to branch**: `git push origin feature/amazing-feature`
5. **Open a Pull Request**

### Ideas for Contributions
- New animation types
- Additional export formats
- Color accessibility tools
- Performance optimizations
- UI/UX improvements
- Documentation improvements
- Bug fixes and testing
- New pattern types
- Mesh gradient enhancements
- AI suggestion improvements

### Development Setup
```bash
# Clone your fork
git clone https://github.com/yourusername/gradient-generator.git
cd gradient-generator

# Create a new branch
git checkout -b feature/your-feature-name

# Make changes and test in browser
# No build process required!

# Commit and push
git add .
git commit -m "Description of changes"
git push origin feature/your-feature-name
```