.. wxPython Phoenix documentation

   This file was generated by Phoenix's sphinx generator and associated
   tools, do not edit by hand.

   Copyright: (c) 2011-2020 by Total Control Software
   License:   wxWindows License

.. include:: headings.inc



.. _wx.SystemAppearance:

==========================================================================================================================================
|phoenix_title|  **wx.SystemAppearance**
==========================================================================================================================================

Provides information about the current system appearance. 
         

An object of this class can be retrieved using :meth:`wx.SystemSettings.GetAppearance`   and can then be queried for some aspects of the current system appearance, notably whether the system is using a dark theme, i.e. a theme with predominantly dark background. 

This is useful for custom controls that don't use the standard system colours, as they need to adjust the colours used for drawing them to fit in the system look. 

Note that this class is only used to query the current appearance, see :meth:`wx.App.SetAppearance <wx.PyApp.SetAppearance>`   for changing it. 


         



.. versionadded:: 4.1/wxWidgets-3.1.3  
     







|

|class_hierarchy| Class Hierarchy
=================================

.. raw:: html

   <div id="toggleBlock" onclick="return toggleVisibility(this)" class="closed" style="cursor:pointer;">
   <img id="toggleBlock-trigger" src="_static/images/closed.png"/>
   Inheritance diagram for class <strong>SystemAppearance</strong>:
   </div>
   <div id="toggleBlock-summary" style="display:block;"></div>
   <div id="toggleBlock-content" style="display:none;">
   <p class="graphviz">
   <center><img src="_static/images/inheritance/wx.SystemAppearance_inheritance.svg" alt="Inheritance diagram of SystemAppearance" usemap="#dummy" class="inheritance"/></center>
   <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
   <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.SystemAppearance.html" title="Provides information about the current system appearance." alt="" coords="5,5,198,34"/> </map> 
   </p>
   </div>

|


|method_summary| Methods Summary
================================

================================================================================ ================================================================================
:meth:`~wx.SystemAppearance.AreAppsDark`                                         Return ``True`` if the applications on this system use dark theme by default.
:meth:`~wx.SystemAppearance.GetName`                                             Return the name if available or empty string otherwise.
:meth:`~wx.SystemAppearance.IsDark`                                              Return ``True`` if the current system there is explicitly recognized as being a dark theme or if the default window background is dark.
:meth:`~wx.SystemAppearance.IsSystemDark`                                        Return ``True`` if the system UI uses dark theme.
:meth:`~wx.SystemAppearance.IsUsingDarkBackground`                               Return ``True`` if the default window background is significantly darker than foreground.
================================================================================ ================================================================================


|


|property_summary| Properties Summary
=====================================

================================================================================ ================================================================================
:attr:`~wx.SystemAppearance.Name`                                                See :meth:`~wx.SystemAppearance.GetName`
================================================================================ ================================================================================


|


|api| Class API
===============


.. class:: wx.SystemAppearance(object)

   Provides information about the current system appearance.



   .. method:: AreAppsDark(self)

      Return ``True`` if the applications on this system use dark theme by default. 
                 

      This function returns ``True`` if dark mode is enabled for the applications system-wide, even if it's not enabled for this particular application. 

      Note that for non-MSW platforms this is currently the same as :meth:`IsDark` , but under MSW these two functions can return different values as dark mode requires to opt-in into it specifically. 


                

      :rtype: `bool`







      .. versionadded:: 4.3/wxWidgets-3.3.0  
     








   .. method:: GetName(self)

      Return the name if available or empty string otherwise. 
                 

      This is currently only implemented for macOS and returns a not necessarily user-readable string such as "NSAppearanceNameAqua" there and an empty string under all the other platforms. 
                 

      :rtype: `str`








   .. method:: IsDark(self)

      Return ``True`` if the current system there is explicitly recognized as being a dark theme or if the default window background is dark. 
                 

      This method should be used to check whether custom colours more appropriate for the default (light) or dark appearance should be used. 

      Note that this checks the appearance of the current application and not the other applications on the system, so under MSW, for example, it will return ``False`` even if dark mode is used system-wide unless the application opted in using dark mode using :meth:`wx.App.MSWEnableDarkMode <wx.PyApp.MSWEnableDarkMode>` . You can use :meth:`IsSystemDark`   or :meth:`AreAppsDark`   to check if the system is using dark mode by default. 
                 

      :rtype: `bool`








   .. method:: IsSystemDark(self)

      Return ``True`` if the system UI uses dark theme. 
                 

      This is the same as :meth:`AreAppsDark`   on the non-MSW platforms, but can be different from the other function under MSW as it is possible to configure default "Windows mode" and "app mode" to use different colour schemes under Windows. 


                

      :rtype: `bool`







      .. versionadded:: 4.3/wxWidgets-3.3.0  
     








   .. method:: IsUsingDarkBackground(self)

      Return ``True`` if the default window background is significantly darker than foreground. 
                 

      This is used by :meth:`IsDark`   if there is no platform-specific way to determine whether a dark mode is being used and is generally not very useful to call directly. 


                

      :rtype: `bool`







      .. seealso:: :meth:`wx.Colour.GetLuminance`     








   .. attribute:: Name

      See :meth:`~wx.SystemAppearance.GetName`

