MCPcopy Create free account
hub / github.com/KLayout/klayout / background_color

Method background_color

src/laybasic/laybasic/layLayoutViewBase.cc:4952–4986  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4950}
4951
4952void
4953LayoutViewBase::background_color (tl::Color c)
4954{
4955 if (c == mp_canvas->background_color ()) {
4956 return;
4957 }
4958
4959 // replace by "real" background color if required
4960 if (! c.is_valid ()) {
4961 c = default_background_color ();
4962 }
4963
4964 tl::Color contrast;
4965 if (c.to_mono ()) {
4966 contrast = tl::Color (0, 0, 0);
4967 } else {
4968 contrast = tl::Color (255, 255, 255);
4969 }
4970
4971 do_set_background_color (c, contrast);
4972
4973 // Set the color for all ViewService interfaces
4974 for (std::vector<lay::Plugin *>::iterator p = mp_plugins.begin (); p != mp_plugins.end (); ++p) {
4975 lay::ViewService *svc = (*p)->view_service_interface ();
4976 if (svc) {
4977 svc->set_colors (c, contrast);
4978 }
4979 }
4980
4981 mp_canvas->set_colors (c, contrast, mp_canvas->active_color ());
4982
4983 update_content ();
4984
4985 background_color_changed_event ();
4986}
4987
4988void
4989LayoutViewBase::dbu_coordinates (bool f)

Callers 6

make_valid_colorMethod · 0.45
set_view_opsMethod · 0.45
background_colorFunction · 0.45
get_bitmapsMethod · 0.45

Calls 6

is_validMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
set_colorsMethod · 0.45
active_colorMethod · 0.45

Tested by

no test coverage detected