# UNPARTY Brand Colors - Usage Guide

Auto-generated color palette for UNPARTY applications.

## Installation

### Download Latest Release

```bash
# Download specific version
VERSION="1.0.0"
curl -LO "https://github.com/unparty-app/theunpartybrand/releases/download/colors-v${VERSION}/unparty-colors.tar.gz"
tar -xzf unparty-colors.tar.gz
```

Or download individual files:

```bash
# CSS
curl -LO "https://github.com/unparty-app/theunpartybrand/releases/latest/download/colors.css"

# Swift
curl -LO "https://github.com/unparty-app/theunpartybrand/releases/latest/download/Colors.swift"

# TypeScript
curl -LO "https://github.com/unparty-app/theunpartybrand/releases/latest/download/colors.ts"

# JSON
curl -LO "https://github.com/unparty-app/theunpartybrand/releases/latest/download/colors.json"
```

## Usage Examples

### CSS (Web Apps)

**1. Direct Import**

```css
@import url('https://github.com/unparty-app/theunpartybrand/releases/latest/download/colors.css');

.header {
  background-color: var(--unparty-yellow);
  color: var(--color-1);
}
```

**2. Download and Include**

```bash
curl -o src/styles/colors.css \
  https://github.com/unparty-app/theunpartybrand/releases/latest/download/colors.css
```

```css
/* In your CSS */
@import './styles/colors.css';

.brand-btn {
  background: var(--brand-primary);
}
```

**3. Build Process Integration**

```json
// package.json
{
  "scripts": {
    "preinstall": "curl -o src/colors.css https://github.com/unparty-app/theunpartybrand/releases/latest/download/colors.css"
  }
}
```

---

### SCSS (Web Apps)

```bash
curl -o src/styles/_colors.scss \
  https://github.com/unparty-app/theunpartybrand/releases/latest/download/colors.scss
```

```scss
// Import in your SCSS
@import './styles/colors';

.hero {
  background: $unparty-yellow;
  color: $color-2;
}
```

---

### JavaScript/TypeScript (Web Apps, API, Backend)

**1. Download to Project**

```bash
# TypeScript
curl -o src/constants/colors.ts \
  https://github.com/unparty-app/theunpartybrand/releases/latest/download/colors.ts

# JavaScript
curl -o src/constants/colors.js \
  https://github.com/unparty-app/theunpartybrand/releases/latest/download/colors.js
```

**2. Usage in Code**

```typescript
// TypeScript
import { colors, unpartyYellow, brandPrimary } from './constants/colors';

const brandStyle = {
  backgroundColor: unpartyYellow,
  color: colors.color1
};

// Use in React
const Header = () => (
  <div style={{ backgroundColor: brandPrimary }}>
    UNPARTY
  </div>
);
```

```javascript
// JavaScript (Node.js/CommonJS)
const { colors, unpartyYellow } = require('./constants/colors');

app.get('/api/theme', (req, res) => {
  res.json({
    primary: unpartyYellow,
    palette: colors
  });
});
```

**3. Fetch Programmatically**

```typescript
// Fetch colors at runtime
async function loadColors() {
  const response = await fetch(
    'https://github.com/unparty-app/theunpartybrand/releases/latest/download/colors.json'
  );
  const colorData = await response.json();
  return colorData.palette;
}
```

---

### Swift (iOS Apps)

**1. Add to Xcode Project**

```bash
# Download Colors.swift
curl -o YourApp/Utils/Colors.swift \
  https://github.com/unparty-app/theunpartybrand/releases/latest/download/Colors.swift
```

**2. Add to Xcode**
- Drag `Colors.swift` into your Xcode project
- Ensure "Copy items if needed" is checked
- Add to your target

**3. Usage in Code**

```swift
import UIKit

class BrandButton: UIButton {
    override init(frame: CGRect) {
        super.init(frame: frame)
        setupStyle()
    }
    
    private func setupStyle() {
        backgroundColor = .unpartyYellow
        setTitleColor(.white, for: .normal)
        layer.cornerRadius = 8
    }
}

// SwiftUI
import SwiftUI

struct ContentView: View {
    var body: some View {
        VStack {
            Text("UNPARTY")
                .foregroundColor(Color(UIColor.unpartyYellow))
            
            Button("Get Started") {
                // Action
            }
            .background(Color(UIColor.brandPrimary))
        }
    }
}
```

**4. Automated Build Integration**

Add build phase script in Xcode:

```bash
#!/bin/bash
# Download latest colors before build
curl -o "${SRCROOT}/YourApp/Utils/Colors.swift" \
  https://github.com/unparty-app/theunpartybrand/releases/latest/download/Colors.swift
```

---

### API/Backend (Node.js, Express, etc.)

**1. Install in Project**

```bash
# Download to your API project
cd your-api-project
curl -o src/config/colors.js \
  https://github.com/unparty-app/theunpartybrand/releases/latest/download/colors.js
```

**2. Use in API Endpoints**

```javascript
const express = require('express');
const { colors, unpartyYellow } = require('./config/colors');

const app = express();

// Serve colors as API endpoint
app.get('/api/v1/theme/colors', (req, res) => {
  res.json({
    version: '1.0.0',
    colors: colors,
    brand: {
      primary: unpartyYellow
    }
  });
});

// Use in email templates
const sendBrandedEmail = (user) => {
  const template = `
    <div style="background-color: ${unpartyYellow};">
      <h1>Welcome to UNPARTY</h1>
    </div>
  `;
  // Send email...
};
```

**3. JSON Consumption**

```javascript
// Load colors from JSON
const axios = require('axios');

async function getLatestColors() {
  const response = await axios.get(
    'https://github.com/unparty-app/theunpartybrand/releases/latest/download/colors.json'
  );
  
  return response.data;
}

// Cache colors in Redis/memory
const colors = await getLatestColors();
```

---

## CI/CD Integration

### GitHub Actions

```yaml
# .github/workflows/update-colors.yml
name: Update Brand Colors

on:
  schedule:
    - cron: '0 0 * * 0'  # Weekly
  workflow_dispatch:

jobs:
  update-colors:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      
      - name: Download Latest Colors
        run: |
          curl -LO https://github.com/unparty-app/theunpartybrand/releases/latest/download/colors.css
          curl -LO https://github.com/unparty-app/theunpartybrand/releases/latest/download/colors.ts
          mv colors.css src/styles/
          mv colors.ts src/constants/
      
      - name: Create PR if Changed
        uses: peter-evans/create-pull-request@v5
        with:
          commit-message: 'chore: update brand colors'
          title: 'Update Brand Colors from Latest Release'
          branch: update-brand-colors
```

---

## Version Management

Colors follow semantic versioning: `MAJOR.MINOR.PATCH`

**Check Current Version:**

```bash
curl -s https://api.github.com/repos/unparty-app/theunpartybrand/releases/latest | jq -r '.tag_name'
```

**Pin to Specific Version:**

```bash
VERSION="1.2.0"
curl -LO "https://github.com/unparty-app/theunpartybrand/releases/download/colors-v${VERSION}/colors.css"
```

---

## Support

For issues or questions about color usage:
- Open an issue: https://github.com/unparty-app/theunpartybrand/issues
- Review changelog: https://github.com/unparty-app/theunpartybrand/releases

---

## License

See LICENSE.md in the repository.
