Changeset 113 for trunk/Packages
- Timestamp:
- Dec 10, 2024, 4:51:28 PM (2 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/Common/Theme.pas
r85 r113 30 30 private 31 31 FTheme: TTheme; 32 function Gray(C: TColor): Byte; 32 33 procedure SetTheme(AValue: TTheme); 33 34 procedure SetThemeName(AValue: TTheme); … … 35 36 Used: Boolean; 36 37 Themes: TThemes; 38 function IsDarkTheme: Boolean; 37 39 procedure ApplyTheme(Component: TComponent); 38 40 constructor Create(AOwner: TComponent); override; … … 93 95 Strings.EndUpdate; 94 96 end; 97 end; 98 99 { TThemeManager } 100 101 function TThemeManager.Gray(C: TColor): Byte; 102 begin 103 Result := Trunc(Red(C) * 0.3 + Green(C) * 0.59 + Blue(C) * 0.11); 104 end; 105 106 function TThemeManager.IsDarkTheme: Boolean; 107 begin 108 Result := Gray(ColorToRGB(clWindow)) < Gray(ColorToRGB(clWindowText)); 95 109 end; 96 110
Note:
See TracChangeset
for help on using the changeset viewer.