zengm-games / facesjs

A JavaScript library for generating vector-based cartoon faces
https://zengm.com/facesjs/
Apache License 2.0
1.28k stars 99 forks source link

New editor is missing the "shave" option #43

Closed dumbmatter closed 6 months ago

dumbmatter commented 6 months ago

From Reddit:

Beautiful new face editor- wonderful job as always. But where is my beloved ‘shave’ option??? any time i wanted to give a player more personality, age them up, or just make them a sexier hunk of a man, i would give em a lil 5’ o clock shadow. i’ve fallen into a deep depression😫 what have you done with my most coveted facial customization parameter sir

Indeed it is missing in the new editor!

In the old editor it was a text field containing something like:

rgba(0,0,0,0.25)

So a transparent black color. Randomizing it just makes the alpha value change somewhere between 0 and 0.5. But you could actually put any color in there.

Ideal UI for shave in the new editor:

  1. For the feature gallery, show rgba(0,0,0,0) through rgba(0,0,0,0.5) spaced at 0.1 (so 6 total, matching some other types of features).
  2. For the selector above that, use https://github.com/uiwjs/react-color to let the user pick a color and alpha value. I recently started using this library in zengm, and I customized one of the default UIs a bit to make it more to my liking (main change is adding the eyedropper if it's supported in your browser and deleting some unused features), we could use a similar thing here just with the alpha slider added back like in the default Sketch component.
  3. (bonus) We could then also use the same color component (with alpha disabled again) for selecting other colors, since it's generally superior to the built-in default browser color selector widget.

@tomkennedy22 are you interested in doing this? If so, please do! If not, just let me know and then I'll do it.

tomkennedy22 commented 6 months ago

Yep it's a good idea & good catch. I can probably have a PR ready in a day or two?

Do you have any thoughts/feelings about having default shave color be the player's existing hair color? And then end-user can change color as they'd like

dumbmatter commented 6 months ago

Yep it's a good idea & good catch. I can probably have a PR ready in a day or two?

Awesome!

Do you have any thoughts/feelings about having default shave color be the player's existing hair color? And then end-user can change color as they'd like

I'm open to it if it looks good, but as a separate PR after this issue. Small PRs are just easier to deal with.