Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Ability to clone an existing icon and "recolorize" it #2304

Closed
lucas-labs opened this issue Apr 25, 2024 · 1 comment · Fixed by #2305
Closed

[Feature] Ability to clone an existing icon and "recolorize" it #2304

lucas-labs opened this issue Apr 25, 2024 · 1 comment · Fixed by #2305

Comments

@lucas-labs
Copy link
Contributor

lucas-labs commented Apr 25, 2024

Hi there @PKief !

I'm working on a feature that some of my teammates have been requesting for my fork.

The idea is to allow (through extension settings) to "clone" an existing icon, but recoloring it to create "variants" of the same icon. When a clone is created, the extension generates a new SVG in the icons/clones folder at runtime and assigns that icon to the folder name/file name/extension that each user has configured in the settings.

I've been doing some proof of concept tests, and I think it's looking good so far (I started with folder icons only).

Ok, talk is cheap, show me the code:

// vscode settings
...
"lucodear-icons.folders.customClones": [ // defines clones of folder icons
  {
    "name": "nice-images", // new name
    "base": "images", // uses the folder-images as a base
    "color": "blue-600", // recolorizes it using blue-500 from material palette as the main color
    "folderNames": ["nice"] // assings it to folder name "nice"
  },
  {
    "name": "meh-images",
    "base": "images",
    "color": "orange-600",
    "folderNames": ["meh"]
  },
  {
    "name": "ugly-images",
    "base": "images",
    "color": "red-400",
    "folderNames": ["ugly"]
  }
],
...

This generates the following:

image

Same icon, different variants. This doesn't apply a filter or something like that; it rewrites the SVG changing styles, attributes, etc. using the material palette.

I wanted to ask if this functionality is something you're interested in having as part of this project. If so, when I have something more polished and tested, I could also create a PR here.

Cheers!

@PKief
Copy link
Owner

PKief commented Apr 25, 2024

Hi @lucas-labs this sounds very promising and would be a nice feature. It was even requested already by other users (see #228). Feel free to work on it and provide a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants