Is there an API to detect which theme the OS is using – dark or light (or other)?

Google has just published the documentation on the dark theme at the end of I/O 2019, here. In order to manage the dark theme, you must first use the latest version of the Material Components library: “com.google.android.material:material:1.1.0-alpha06”. Change the application theme according to the system theme For the application to switch to the dark theme … Read more

How to detect if OS X is in dark mode?

Don’t think there’s a cocoa way of detecting it yet, however you can use defaults read to check whether or not OSX is in dark mode. defaults read -g AppleInterfaceStyle Either returns Dark (dark mode) or returns domain pair does not exist. EDIT: As Ken Thomases said you can access .GlobalPreferences via NSUserDefaults, so NSString … Read more

Modifying the color of an android drawable

So after a lot of trial and error, reading different articles, and most importantly, going through the API Demos (ColorFilters.java — found in com.example.android.apis.graphics) I found the solution. For solid images, I have found it is best to use the color filter PorterDuff.Mode.SRC_ATOP because it will overlay the color on top of the source image, … Read more

How to edit default dark theme for Visual Studio Code?

In VS code ‘User Settings’, you can edit visible colours using the following tags (this is a sample and there are much more tags): “workbench.colorCustomizations”: { “list.inactiveSelectionBackground”: “#C5DEF0”, “sideBar.background”: “#F8F6F6”, “sideBar.foreground”: “#000000”, “editor.background”: “#FFFFFF”, “editor.foreground”: “#000000”, “sideBarSectionHeader.background”: “#CAC9C9”, “sideBarSectionHeader.foreground”: “#000000”, “activityBar.border”: “#FFFFFF”, “statusBar.background”: “#102F97”, “scrollbarSlider.activeBackground”: “#77D4CB”, “scrollbarSlider.hoverBackground”: “#8CE6DA”, “badge.background”: “#81CA91” } If you want to … Read more

How do you set the title color for the new Toolbar?

Option 1) The quick and easy way (Toolbar only) Since appcompat-v7-r23 you can use the following attributes directly on your Toolbar or its style: app:titleTextColor=”@color/primary_text” app:subtitleTextColor=”@color/secondary_text” If your minimum SDK is 23 and you use native Toolbar just change the namespace prefix to android. In Java you can use the following methods: toolbar.setTitleTextColor(Color.WHITE); toolbar.setSubtitleTextColor(Color.WHITE); These … Read more

Any free WPF themes? [closed]

The only one that I have found (for sale) is reuxables. A little pricey, if you ask me, but you do get 9 themes/61 variations. UPDATE 1: A WPF Contrib project … which does have 1 theme that they never released. UPDATE 2: Rudi Grobler (above) just created CodePlex community for this … starting with … Read more

Where can I download Microsoft’s standard WPF themes from? [closed]

The download links are identical between .NET 3.0 and .NET 3.5–only the online documentation is different. Themes for .NET 3.0 Classic (download) Luna (download) Royale (download) Aero (download) Themes for .NET 3.5 Classic (download) Luna (download) Royale (download) Aero (download) WPF Documentation Samples for .NET 4 and .NET 4.5 Themes (download) (No longer available) Classic … Read more

Angular 2/4 component with dynamic template or templateUrl

You can do it like this: import { Compiler, Component, Injector, VERSION, ViewChild, NgModule, NgModuleRef, ViewContainerRef } from ‘@angular/core’; @Component({ selector: ‘my-app’, template: ` <h1>Hello {{name}}</h1> <ng-container #vc></ng-container> ` }) export class AppComponent { @ViewChild(‘vc’, {read: ViewContainerRef}) vc; name = `Angular! v${VERSION.full}`; constructor(private _compiler: Compiler, private _injector: Injector, private _m: NgModuleRef<any>) { } ngAfterViewInit() { … Read more

tech