effigy.im icon indicating copy to clipboard operation
effigy.im copied to clipboard

Convert SVG color generation from HSL to RGB

Open sweep-ai[bot] opened this issue 4 months ago • 2 comments

Purpose

Modify the SVG identicon generation process to use RGB color values instead of HSL. This change will improve the visual appearance and consistency of the generated SVG icons.

Description

The changes in this pull request include:

  1. Updating the functions/lib/blockiesSVG.js file:
    • Modifying the createColor() function to generate RGB values instead of HSL
    • Updating the renderIdenticon() function to use RGB color strings
  2. Renaming the functions/lib/hsl2rgb.js file to functions/lib/rgb.js and adding a new function createRandomRGBColor() to generate random RGB colors.
  3. Adjusting any imports or requires in other files that reference hsl2rgb.js.
  4. Adding unit tests in functions/test/blockiesSVG.test.js to ensure the new RGB color generation works correctly.
  5. Updating comments in functions/lib/blockiesSVG.js to reflect the change from HSL to RGB.

Summary

  • Updated functions/lib/blockiesSVG.js to use RGB colors instead of HSL
  • Renamed functions/lib/hsl2rgb.js to functions/lib/rgb.js and added createRandomRGBColor()
  • Added unit tests for the new RGB color generation in functions/test/blockiesSVG.test.js
  • Updated comments in functions/lib/blockiesSVG.js to reflect the change

Fixes

#20. Continue the conversation here: https://app.sweep.dev/c/e6fa7d0c-d0ab-4b2f-bf76-a7aaea6a379f.

To have Sweep make further changes, please add a comment to this PR starting with "Sweep:".

:book: For more information on how to use Sweep, please read our documentation.

Tracking ID: 49d33b19ed

sweep-ai[bot] avatar Oct 11 '24 02:10 sweep-ai[bot]