Giter Site home page Giter Site logo

Comments (9)

jmaen avatar jmaen commented on June 26, 2024

I played around with it a little just for fun, I imagine it could look something like that (sorry for the color artifacts):

color-picker

from motion-canvas.

aarthificial avatar aarthificial commented on June 26, 2024

While it's true that we'll need a color picker sooner or later for the sake of editable signals, I am strongly against using third-party components in the editor as they destroy any sense of consistency in terms of the visuals and the feel.

It's important to keep in mind that Motion Canvas is meant to feel like a desktop application and not a website.
Here's an example of the color picker from Blender:
image
Most notably, it uses HSV sliders that both look and work the same as any other field in the application.

As such, the color picker should be implemented using our own components.
This shouldn't be too complex as it's just a few sliders and two CSS gradients on top of each other.
We also already depend on chroma-js which provides all the logic necessary for color conversion an manipulation.

from motion-canvas.

jmaen avatar jmaen commented on June 26, 2024

I'll look into that. I guess the new NumberInput will come in handy for the sliders.

from motion-canvas.

jmaen avatar jmaen commented on June 26, 2024

Does it have to be the same layout as in Blender, i.e. one (circular) map for hue and saturation and another one for brightness, or would you also be fine with one map for saturation and brightness and another linear one for hue (as in the gif I sent)? I think the latter would be easier to implement and I like the easy way of keeping the saturation and brightness while playing around with the hue, but I guess that comes down to personal preference.

from motion-canvas.

aarthificial avatar aarthificial commented on June 26, 2024

Yes, the square + hue slider from the gif is better. It's common in most drawing software so I think it would be a good default.

from motion-canvas.

jmaen avatar jmaen commented on June 26, 2024

I had some other things going on but I finally got to work on it again. The functionality is there now but before spending time on styling I wanted to clarify how exactly you imagine the component to look like.

That's the current (temporary) state:
grafik

Some feedback would be great @aarthificial !

from motion-canvas.

aarthificial avatar aarthificial commented on June 26, 2024

Looking good so far!
Here are some tweaks:
image

  1. The vertical gap should be 8px everywhere, and the padding should be 16px to be consistent with the rest of the editor.
    Here's it on a 4x4px grid:
    image
  2. Selection circles should be 12x12px with the one over the hue being black to stand out better.
  3. Values should be presented with 4 decimal places
  4. Inputs should have nested labels on the left
  5. There should be an alpha/opacity slider at the bottom.
  6. Hue should range from 0 to 1 (Consistent with Blender)

from motion-canvas.

jmaen avatar jmaen commented on June 26, 2024

Great, got everything looking good now. Just one more thing, where do you want the popover to be located relative to the color preview? Just some fixed distance to the right? If it just opens where the click happens, the background blends with the rest of the settings pane.
Or do you want to make the popover background darker, the way Blender handles it?

from motion-canvas.

aarthificial avatar aarthificial commented on June 26, 2024

Having it fixed on the right is ok for now, 12px to match the padding around the zoom picker.
Tho I'm also considering making it collapsible, similarly to how colors in the inspector are presented:
image
I think in the future this would work better with the inspector on the right

from motion-canvas.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.