-
-
Notifications
You must be signed in to change notification settings - Fork 18.9k
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
Save color palette as resources to reuse later #91604
base: master
Are you sure you want to change the base?
Conversation
99416da
to
8ad7da9
Compare
This should use icons available at runtime, not editor icons, there are some appropriate ones available, and otherwise they should be added, this shouldn't depend on the editor |
7c37110
to
0839503
Compare
I approve of allowing saving the color pallete from a usability team perspective. |
Update:
@AThousandShips What do you mean when you say |
Icons available at runtime are those which aren't editor specific, meant in running projects not running the program itself sorry for confusion |
0839503
to
6084096
Compare
04ebe85
to
acdd5f8
Compare
Sorry for the annoying force push. I wasn't familiar with the TTR part. I need one more favor. I couldn't find the correct icon to use in the function |
If it isn't in the default theme But I think the normal folder icon is sufficient Gonna test this one probably tomorrow but code looks good, got some final remarks I'll add when I've tested it out |
I wonder if it should be possible to give a name to each color, and have the name displayed in a tooltip when hovering the color in the ColorPicker's swatch list. It's common for designers to assign names to colors to make slightly different colors easier to distinguish from each other, or even to refer to them in natural language. If I refer to "lime 800" from Tailwind's color palette, you can immediately know it's This could be left to a future PR, but we should make sure this feature can be implemented in the future without breaking compatibility (i.e. without changing the data structure in the resource). |
768da7a
to
10f2235
Compare
Tested and it works as expected, however I don't think the list of resources allowed makes sense, it should probably just limit to Edit: correction, it shouldn't even be that, it should be some binary format dedicated to this, it doesn't actually store a |
I suggest using ConfigFile to save palettes as opposed to FileAccess, so you have a text format that is friendly to version control. I'd also give them a custom file extension so they can be targeted more specifically, e.g. A similar approach is used for script editor syntax themes, which use a |
feca7e7
to
1e0de24
Compare
e7d39f0
to
cef22b9
Compare
cef22b9
to
1093718
Compare
0b1cb4e
to
640ac77
Compare
This comment was marked as resolved.
This comment was marked as resolved.
640ac77
to
c09956a
Compare
This comment was marked as resolved.
This comment was marked as resolved.
c09956a
to
9e8928d
Compare
This comment was marked as resolved.
This comment was marked as resolved.
9e8928d
to
553d130
Compare
scene/gui/color_picker.cpp
Outdated
@@ -857,10 +976,17 @@ void ColorPicker::add_preset(const Color &p_color) { | |||
_add_preset_button(_get_preset_size(), p_color); | |||
} | |||
|
|||
if (palette_name->get_text().size()) { | |||
palette_name->set_text(vformat("%s*", palette_name->get_text().replace("*", ""))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the replace()
for? If you want to remove ending *
, use trim_suffix("*")
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd also suggest (*)
to match the scene tabs in the editor as well as the script editor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it is related to the editor or script editor, and it might unnecessarily confuse users who keep pressing Ctrl+S to save changes, but the color picker doesn't respond and keeps showing the (*) on these editors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see how that'd be any more or less confusing because of that
553d130
to
cc034a0
Compare
I think only the palette, because it's foldable. Although if you simply put a ScrollContainer it will likely be too small. Not sure how to solve that. |
I could introduce a foldable left side panel to the color picker, which will have a height equal to the ColorPicker's height. With the space acquired, I could implement the ability to give a name to each color. Perhaps, I could also allow users to dynamically resize this panel. With that, I could also allow users to load multiple palettes simultaneously. Edit: Please note, I have a personal workload that will end in August, which requires me to put all my effort into it. Therefore, I will take a break from this and come back when it's done. |
options_menu = memnew(PopupMenu); | ||
add_child(options_menu, false, INTERNAL_MODE_FRONT); | ||
options_menu->force_parent_owned(); | ||
options_menu->connect("id_pressed", callable_mp(this, &ColorPicker::_options_menu_cbk)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
options_menu->connect("id_pressed", callable_mp(this, &ColorPicker::_options_menu_cbk)); | |
options_menu->connect(SceneStringName(id_pressed), callable_mp(this, &ColorPicker::_options_menu_cbk)); |
New constant
Close godotengine/godot-proposals#7946
The lack of a palette library slows down development time because swatches contain many colors that may not match the mood an artist is trying to achieve. This can hinder their workflow as they search for the right color within a large set of mostly irrelevant options.
Untitled.video.-.Made.with.Clipchamp.mp4