Skip to content

feat(routes-f): random hex color generator with constraints (reissue) #755

@davedumto

Description

@davedumto

Summary

Add a random color generator at app/api/routes-f/random-color/route.ts. Generate colors with optional style constraints.

Requirements

  • GET ?count=5&type=any|pastel|vibrant|grayscale&seed=42
  • Return { colors: [{ hex, rgb, hsl }] }
  • Default count 1, max 100
  • pastel: high lightness, low saturation
  • vibrant: high saturation, mid lightness
  • grayscale: r=g=b
  • Seed makes deterministic
  • Tests verify each type produces colors in expected HSL ranges

Scope Constraint - READ BEFORE STARTING

All files for this task must live inside app/api/routes-f/. This includes the route handler, helpers/utilities, types, and tests. Do NOT modify, import from, or add files to lib/, utils/, types/, components/, or anywhere else outside app/api/routes-f/. If you need shared logic, duplicate it inside your subfolder. Keeping everything scoped to this folder is intentional - it keeps these tasks independent and mergeable in any order.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions