From 7b49d94e9f3edc52ad478dc6cf95520f7a8b6c62 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 6 Oct 2016 15:27:24 -0700 Subject: [PATCH] Add systemPreferences.isInvertedColorScheme API --- atom/browser/api/atom_api_system_preferences.cc | 3 +++ spec/api-system-preferences-spec.js | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/atom/browser/api/atom_api_system_preferences.cc b/atom/browser/api/atom_api_system_preferences.cc index 6d3897b197be..0c7cbe2fba8d 100644 --- a/atom/browser/api/atom_api_system_preferences.cc +++ b/atom/browser/api/atom_api_system_preferences.cc @@ -8,6 +8,7 @@ #include "atom/common/native_mate_converters/value_converter.h" #include "atom/common/node_includes.h" #include "native_mate/dictionary.h" +#include "ui/gfx/color_utils.h" namespace atom { @@ -60,6 +61,8 @@ void SystemPreferences::BuildPrototype( .SetMethod("isSwipeTrackingFromScrollEventsEnabled", &SystemPreferences::IsSwipeTrackingFromScrollEventsEnabled) #endif + .SetMethod("isInvertedColorScheme", + &color_utils::IsInvertedColorScheme) .SetMethod("isDarkMode", &SystemPreferences::IsDarkMode); } diff --git a/spec/api-system-preferences-spec.js b/spec/api-system-preferences-spec.js index 16992c31e112..03bff26ad82e 100644 --- a/spec/api-system-preferences-spec.js +++ b/spec/api-system-preferences-spec.js @@ -30,4 +30,10 @@ describe('systemPreferences module', function () { assert(languages.length > 0) }) }) + + describe('systemPreferences.isInvertedColorScheme()', function () { + it('returns a boolean', function () { + assert.equal(typeof systemPreferences.isInvertedColorScheme(), 'boolean') + }) + }) })