Base: Rename classes

This commit is contained in:
Jonathan Jenne
2023-05-23 12:03:22 +02:00
parent a856f5f1b3
commit fd2ad3f056
5 changed files with 76 additions and 35 deletions

16
Base/GraphicsEx.vb Normal file
View File

@@ -0,0 +1,16 @@
Imports System.Drawing
Public Class GraphicsEx
Public Shared Function GetBrightness(c As Color) As Single
Return (c.R * 0.299F + c.G * 0.587F + c.B * 0.114F) / 256.0F
End Function
Public Shared Function GetContrastedColor(pOtherColor As Color) As Color
If GetBrightness(pOtherColor) < 0.55 Then
Return Color.White
Else
Return Color.Black
End If
End Function
End Class