[Gambas-bugtracker] Bug #2247: Dark theme issues

bugtracker at gambaswiki.org bugtracker at gambaswiki.org
Tue Jun 29 21:05:15 CEST 2021


http://gambaswiki.org/bugtracker/edit?object=BUG.2247&from=L21haW4-

Comment #6 by Benoît MINISINI:

You can write your own version Color.Invert() in Gambas:

1) Get the luminance of the color with Color[].Luminance

2) Invert it that way:

Function InvertColorLuminance(L As Integer)

  Dim M As Float = 0.7;
  Dim D As Float = L / 255;

  If D < M Then
    D = 1 - (D * (1 - M) / M)
  Else
    D = (1 - D) * M / (1 - M);

  Return 255 * D

End

3) Set the color luminance with that.

P.S. "à dieu" must be written "Adieu", and if you write "mon amie" with an "e", it means that I am a woman. :-)




More information about the Bugtracker mailing list