gdquest-demos / godot-kickstarter-2019

Create your Own Games with Godot, the Free Game Engine: sources from the January Kickstarter project from GDQuest
MIT License
244 stars 270 forks source link

Add-on: Color palette #20

Closed NathanLovato closed 5 years ago

NathanLovato commented 5 years ago

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

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 commented 5 years ago

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 commented 5 years ago

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.