Skip to content
Mahdi Safsafi edited this page May 26, 2017 · 3 revisions

First step:

Create a new ImmersiveColors object

var
  m: TImmersiveColors;
begin
  m := TImmersiveColors.Create;
end;

Checking if immersive colors are supported by your OS:

use TImmersiveColors.IsImmersiveColorsSupported property to check if immersive colors are supported.

if m.IsImmersiveColorsSupported then
// Supported.

Getting Active color set:

var
  ActiveSet: TColorSet;
begin
  ActiveSet := m.ActiveColorSet;
end;

Accessing Immersive colors:

You can get Immersive color value using TColorSet.Colors property.

  Color := ActiveSet.Colors[ImmersiveSaturatedBackground];

For a complete list of available immersive colors, refer to TImmersiveColorType type.

Get notified when user changes Immersive colors settings:

procedure TMain.ColorSetChanged(Sender: TObject);
begin
  // This method will get called each time the user changes immersive colors settings.
end;
begin
  m.OnColorSetChanged := ColorSetChanged;
end;