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

Add-on: Color palette #20

Closed
4 tasks
NathanLovato opened this issue Feb 5, 2019 · 2 comments · Fixed by #23
Closed
4 tasks

Add-on: Color palette #20

NathanLovato opened this issue Feb 5, 2019 · 2 comments · Fixed by #23
Assignees

Comments

@NathanLovato
Copy link
Contributor

NathanLovato commented Feb 5, 2019

Problem

We're going to have a styleguide with fixed colors, but we don't have a convenient way to assign these colors to icons, bars, text, etc.

This goes for tutorial slideshows made in Godot as well as debug interfaces or tools we might create.

Color palette

  • Palette widget: should generate a list of buttons from a JSON file.
  • Clicking a button should assign the color to the modulate property of the selected node.
  • The individual buttons/swatches in the palette shouldn't return color objects! The idea is to reuse the components for other tools, e.g. a RichTextLabel editor, where the color will be a string in bbcode tags. Each button should only return a hex color string!
  • The color palette should only be a widget! We should put multiple widgets in a single docker.

NB: No need to support RGBA values, only hex. Note in Godot the hex format is AARRGGBB or RRGGBB: alpha comes first.

Interface

I prepared some UI prototype, see the attached zip : ColorPalette.zip

One gridcontainer per palette section/category. Keep it this simple: no need for a fluid layout or foldable categories. We're only going to have a handful of swatches to start with, making an elaborate UI would be a waste of time at this point.

Krita's palette docker is a good reference for the layout: simple and efficient.

screenshot from 2019-02-05 11-00-47

"palette_name" : {
    "category_name": [
        "color_uid" : "ffffff",
        "color_uid" : "000000"
    ]
}
@henriiquecampos
Copy link
Contributor

henriiquecampos commented Feb 9, 2019

The color palette should only be a widget! We should put multiple widgets in a single docker.

I didn't get this part. We can display multiple palettes at the same time inside, let's say, a PaletteContainer? Or will we be able, as seems to be in the reference, load a palette at time and then have a menu to select which palette the widget must display?

@NathanLovato
Copy link
Contributor Author

No, what I meant is that the palette component should be decoupled from everything else in the plugin, like any UI component. Among other things, it shouldn't be bound to the modulate property: a palette should only be a set of buttons that represent and return colors when they're pressed. Then another system takes care of applying the color to a node.

You can put your WIP for review if you want.

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