Jump to content

Farbauswahl in Add-on Settings? / Colour selection in add-on settings?


---
 Share

Recommended Posts

Hallo allerseits,

gibt es die Möglichkeit, in "metainfo.json" eine Farbauswahl zu programmieren, so dass diese in den entsprechenden Add-on Settings in den Voreinstellungen angezeigt wird? In der Dokumentation zu den Add-on Settings ist dazu leider nichts enthalten.

Vielen Dank im voraus für eine Info dazu!

-------------------------------------------

Hello everyone,

Is it possible to program a colour selection in "metainfo.json" so that it is displayed in the corresponding add-on settings in the default settings? Unfortunately, there is nothing in the documentation for the add-on settings.

Many thanks in advance for any information on this!

-------------------------------------------

image.png.3acc9bc6d93b70437abf83cc4a36729f.png

Link to comment
Share on other sites

Hello Mr. Gallasch,

'file' is currently the only non-basic type provided. I suggest to store the color settings as a string containing either the hex value or the color name.

  • If you want to use the color in the context of an HTML element, you can use the color string directly if you adhere to the HTML color syntax.
  • If you need a gom.Color object, you can convert a color name to RGBA values (or vice versa) using the Python package 'webcolors'.

To convert between RGBA values and gom.Color object:

color = gom.color(r, g, b, a)
r = color.r
g = color.g
b = color.b
a = color.a

Hope this helps!

Best regards,

Matthias Prinke

 

Link to comment
Share on other sites

Hello Mr. Prinke,
Thank you for your reply and for pointing out that the “file” type is currently the only “exotic” type that can be used here.
What I actually need is shown in the attached photomontage...

image.thumb.png.a06e6cb11c5b934eca66b4ae2849951f.png

Link to comment
Share on other sites

Hello Mr. Gallasch,

I already assumed that you had this in mind. A color selection widget is currently not implemented in the Add-on Settings. Please feel free to file a request via Software Support.

Best regards,

Matthias Prinke

Link to comment
Share on other sites

 Share

×
×
  • Create New...