<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Perfect.</p>
<p><span class="tlid-translation translation" lang="en"><span
title="" class="">I followed the method of color luminance and
as I use version 3.14 I used the code snippet from the gambas
ide sources like.</span></span></p>
<p> hColor = Color[Color.ButtonBackground]<br>
<br>
If hColor.Luminance > 160 Then<br>
Paint.Brush = Paint.Color(Color.Black)<br>
Else<br>
Paint.Brush = Paint.Color(Color.White)<br>
Endif</p>
<p>Tanks.</p>
<p>Martín.<br>
</p>
<p><br>
</p>
<div class="moz-cite-prefix">El 6/7/20 a las 16:23, Benoît Minisini
escribió:<br>
</div>
<blockquote type="cite"
cite="mid:d2cf895b-b920-81ba-c37c-b5a94500f069@gmail.com">Le
06/07/2020 à 15:45, Martin Belmonte a écrit :
<br>
<blockquote type="cite">Hi,
<br>
<br>
What method uses Gambas to determine if the desktop theme is
dark or light?
<br>
I try to find out so that the programs I made with Gambas adapt
to the desktop in other aspects beyond the standard icons and
the color of the text.
<br>
Specifically I use paint to draw by code the images that I will
show in drawing tools.
<br>
Regards.
<br>
<br>
Martín.
<br>
<br>
</blockquote>
<br>
The Application.DarkTheme property is TRUE if:
<br>
<br>
- The luminance of the default background color is lower or equal
than 50%.
<br>
<br>
- Or if the GB_GUI_DARK_THEME environment variable is set to an
integer number different from zero.
<br>
<br>
Regards,
<br>
<br>
</blockquote>
</body>
</html>