diff --git a/core/modules/color/color.module b/core/modules/color/color.module
index fe7c40b..21bf14b 100644
--- a/core/modules/color/color.module
+++ b/core/modules/color/color.module
@@ -417,6 +417,7 @@ function color_scheme_form_submit($form, FormStateInterface $form_state) {
   // No change in color config, use the standard theme from color.inc.
   if (implode(',', color_get_palette($theme, TRUE)) == implode(',', $palette)) {
     $config->delete();
+    Cache::invalidateTags(['library_info']);
     return;
   }
 
diff --git a/core/modules/color/src/Tests/ColorTest.php b/core/modules/color/src/Tests/ColorTest.php
index 3456dca..f345f95 100644
--- a/core/modules/color/src/Tests/ColorTest.php
+++ b/core/modules/color/src/Tests/ColorTest.php
@@ -96,6 +96,60 @@ function testColor() {
   }
 
   /**
+   * Tests the color module functionality by switching between color sets.
+   */
+  function testColorSets() {
+    $this->config('system.theme')
+      ->set('default', 'bartik')
+      ->save();
+    $settings_path = 'admin/appearance/settings/bartik';
+    $this->drupalLogin($this->bigUser);
+
+    $set_iterations = array(
+      'iteration_one' => array(
+        'set_name' => 'default',
+        'scheme_color' => '#3b3b3b',
+      ),
+      'iteration_two' => array(
+        'set_name' => 'plum',
+        'scheme_color' => '#301313',
+      ),
+      'iteration_three' => array(
+        'set_name' => 'default',
+        'scheme_color' => '#3b3b3b',
+      ),
+    );
+
+    foreach ($set_iterations as $key => $set) {
+      $this->drupalGet($settings_path);
+      $this->assertResponse(200);
+      $edit['scheme'] = $set['set_name'];
+      $this->drupalPostForm($settings_path, $edit, t('Save configuration'));
+
+      $this->drupalGet('<front>');
+      $stylesheets = $this->config('color.theme.bartik')->get('stylesheets');
+      foreach ($stylesheets as $stylesheet) {
+        $stylesheet_content = join("\n", file($stylesheet));
+        $this->assertTrue(strpos($stylesheet_content, 'color: ' . $set['scheme_color']) !== FALSE, 'Make sure the color we changed is in the color stylesheet. (' . $set['set_name'] . ')');
+      }
+
+      // Test with aggregated CSS turned on.
+      $config = $this->config('system.performance');
+      $config->set('css.preprocess', 1);
+      $config->save();
+      $this->drupalGet('<front>');
+      $stylesheets = \Drupal::state()->get('drupal_css_cache_files') ?: array();
+      $stylesheet_content = '';
+      foreach ($stylesheets as $uri) {
+        $stylesheet_content .= join("\n", file(drupal_realpath($uri)));
+      }
+      $this->assertTrue(strpos($stylesheet_content, 'public://') === FALSE, 'Make sure the color paths have been translated to local paths. (' . $set['set_name'] . ')');
+      $config->set('css.preprocess', 0);
+      $config->save();
+    }
+  }
+
+  /**
    * Tests the Color module functionality using the given theme.
    *
    * @param string $theme
