essentivit / essentivit-Pattern-Lab

Scripts associated with product label pattern generation
0 stars 0 forks source link

Feature Request: Palette Selection & Product Configurations #3

Open essentivit opened 2 months ago

essentivit commented 2 months ago

Feature Request: Palette Selection & Product Configurations

Summary: We need to enhance the pattern generation app by introducing a feature that allows users to select specific palette combinations through a dropdown menu. These palettes should correspond to defined palettes for particular products. Additionally, the app should provide functionality to save and reuse these seed and palette configurations for future use. The goal is to allow both random generation and defined palette combinations while ensuring the ability to regenerate patterns for specific products.


Detailed Requirements:

  1. Palette Selection UI:

    • Add a dropdown menu to the UI to allow users to select predefined palettes.
    • This dropdown should list palettes associated with specific products, allowing users to regenerate patterns using the same configurations for labels or branding.
  2. Random Palette Generation:

    • The option for random palette selection should remain. When selected, the app should generate a random palette combination based on a seed and the available color palettes.
    • If a random palette is chosen, the user should still have the option to save the combination (seed + palette) for future use.
  3. Switching from CSV to a More Suitable Format:

    • The current CSV format may not be optimal for handling palette combinations.
    • Consider switching to a JSON format, where each product can have a name, a unique identifier, and its associated palette(s).
    • Each palette entry should include a list of RGB values for multiple colours, making it easier to manage predefined palettes.
  4. Saving & Loading Configurations:

    • Add the ability to save the generated combinations (seed + palette) with a product name/identifier.
    • Users should be able to select previously saved configurations from the UI.
    • Saved configurations should persist across sessions, likely using local storage or a backend service if applicable.
  5. Regenerating Saved Configurations:

    • The app should provide the ability to regenerate patterns based on saved configurations. This should include the correct application of the seed and palette.
  6. Versioning and Maintenance:

    • Ensure version control is in place for palette configurations to avoid discrepancies when regenerating past configurations.

Acceptance Criteria:

Dependencies:

essentivit commented 2 months ago

Update: Decision on Palette and Configuration Storage

After consideration, we have decided to proceed using one JSON file for palettes and one JSON file for configurations.

This decision is based on the expectation that the number of configurations will remain between 100 and 200. Given this scale, managing palettes and configurations within centralised files is both efficient and straightforward for the current scope of the project. It simplifies maintenance and access without introducing unnecessary complexity.

Example: palettes.json

{
  "palettes": [
    {
      "id": "essential_vitamin",
      "name": "Essential Vitamin",
      "colors": [
        [178, 223, 138],
        [166, 206, 227],
        [51, 160, 44],
        [251, 154, 153],
        [227, 26, 28]
      ]
    },
    {
      "id": "pet_supplement",
      "name": "Pet Supplement",
      "colors": [
        [253, 191, 111],
        [31, 120, 180],
        [106, 61, 154],
        [202, 178, 220],
        [177, 89, 40]
      ]
    },
    {
      "id": "beauty_product",
      "name": "Beauty Product",
      "colors": [
        [255, 204, 229],
        [255, 153, 204],
        [204, 102, 153],
        [153, 51, 102],
        [102, 0, 51]
      ]
    }
  ]
}

Example: configurations.json

{
  "configurations": [
    {
      "id": "config_01",
      "seed": 123456,
      "palette": "essential_vitamin",
      "timestamp": "2024-09-22T12:34:56",
      "description": "Default essential vitamin pattern for product label."
    },
    {
      "id": "config_02",
      "seed": 7891011,
      "palette": "pet_supplement",
      "timestamp": "2024-09-23T14:22:01",
      "description": "Pet supplement branding for new product line."
    },
    {
      "id": "config_03",
      "seed": 11223344,
      "palette": "beauty_product",
      "timestamp": "2024-09-24T10:15:32",
      "description": "Beauty product packaging pattern."
    }
  ]
}
essentivit commented 2 months ago

Update: Migration to JSON for Palette Handling

In preparation for the requested feature, we've made the following key changes:

These changes are foundational for the upcoming feature that will allow users to select palettes and save pattern configurations for specific products.