ScriptFu: fix #11001

At script create time, create a GimpRGB i.e. pixel from the declared name of default color.

At plugin procedure registration time, convert that pixel to GeglColor,
and use that color to declare the color arg using GeglParamSpecColor(default=color)

Fixes a faulty fix a few commits back where we lost the declared color name.
The proper dataflow is  name->color->paramspec-with-default-color.
This commit is contained in:
bootchk
2024-03-06 09:55:38 -05:00
parent f7c876dfd3
commit 279341a237
3 changed files with 2 additions and 34 deletions

View File

@ -292,20 +292,12 @@ script_fu_arg_get_param_spec (SFArg *arg,
break;
case SF_COLOR:
/* FIXME by name is wrong, but that is a separate issue from refactor. */
/* Set the default by name. */
/* G_PARAM_READWRITE vs GIMP_PARAM_READWRITE, they are not equal. */
pspec = gegl_param_spec_color_from_string (name, nick, arg->label,
sf_color_arg_get_name_of_default (arg),
G_PARAM_READWRITE);
/* FIXME instead use this
{
GeglColor *color = sf_color_arg_get_color_of_default (arg);
GeglColor *color = sf_color_arg_get_default_color (arg);
pspec = gegl_param_spec_color (name, nick, arg->label, color, G_PARAM_READWRITE);
g_object_unref (color);
}
*/
break;
case SF_TOGGLE: