It looks like you're new here. If you want to get involved, click one of these buttons!
Hi, probably it's a very easy question, but it stucked me so much time. I want to know how to set/change layer color in a given layer. My stiuation is as follows.
Comments
I guess you got that from ChatGPT, not by reading the docs.
You don't change the layer color on the
Layout
object. The object managing the layer colors isLayoutView
. This is also the only way to display a layout.The API is described here: https://www.klayout.de/doc-qt5/programming/application_api.html#h2-154 (look for "Working with layer properties").
Matthias
@Matthias Thank you ! But I have a new question. Can I set color in layout setup script ? I have known how to change color in a existing layout.
The usual way is not to set layers one by one but to prepare a layer properties file and load it into the view with "load_layer_properties".
Maybe you can be a little more specific on what exactly you are trying to do?
Matthias