diff --git i/core/modules/color/color.admin-rtl.css w/core/modules/color/color.admin-rtl.css
index d5bfbe8..2e58f07 100644
--- i/core/modules/color/color.admin-rtl.css
+++ w/core/modules/color/color.admin-rtl.css
@@ -14,16 +14,16 @@
   padding-right: 1em;
 }
 .color-form label {
-  float: right;
   clear: right;
+  float: right;
 }
 .color-form .form-text,
 .color-form .form-select {
   float: right;
 }
 .color-form .form-text {
-  margin-right: 0;
   margin-left: 5px;
+  margin-right: 0;
 }
 #palette .hook {
   float: right;
diff --git i/core/modules/color/color.admin.css w/core/modules/color/color.admin.css
index e9aee91..5b5c156 100644
--- i/core/modules/color/color.admin.css
+++ w/core/modules/color/color.admin.css
@@ -10,20 +10,20 @@
 }
 #placeholder {
   position: absolute;
-  top: 0;
   right: 0; /* LTR */
+  top: 0;
 }
 
 /* Palette */
 .color-form .form-item {
   height: 2em;
   line-height: 2em;
-  padding-left: 1em; /* LTR */
   margin: 0.5em 0;
+  padding-left: 1em; /* LTR */
 }
 .color-form label {
-  float: left; /* LTR */
   clear: left; /* LTR */
+  float: left; /* LTR */
   width: 10em;
 }
 .color-form .form-text,
@@ -31,16 +31,16 @@
   float: left; /* LTR */
 }
 .color-form .form-text {
-  text-align: center;
-  margin-right: 5px; /* LTR */
   cursor: pointer;
+  margin-right: 5px; /* LTR */
+  text-align: center;
 }
 
 #palette .hook {
   float: left; /* LTR */
+  height: 16px;
   margin-top: 3px;
   width: 16px;
-  height: 16px;
 }
 #palette .down,
 #palette .up,
@@ -55,14 +55,14 @@
 }
 
 #palette .lock {
+  background: url(images/lock.png) no-repeat 50% 2px;
+  cursor: pointer;
   float: left; /* LTR */
+  height: 25px;
+  left: -10px; /* LTR */
   position: relative;
   top: -1.4em;
-  left: -10px; /* LTR */
   width: 20px;
-  height: 25px;
-  background: url(images/lock.png) no-repeat 50% 2px;
-  cursor: pointer;
 }
 #palette .unlocked {
   background-position: 50% -22px;
@@ -80,6 +80,6 @@
 }
 .js #preview {
   display: block;
-  position: relative;
   float: left; /* LTR */
+  position: relative;
 }
diff --git i/core/modules/color/color.module w/core/modules/color/color.module
index d4ca6ca..9a9b10b 100644
--- i/core/modules/color/color.module
+++ w/core/modules/color/color.module
@@ -139,7 +139,7 @@ function color_get_palette($theme, $default = FALSE) {
 /**
  * Form constructor for the color configuration form for a particular theme.
  *
- * @param $theme
+ * @param String $theme
  *   The machine name of the theme whose color settings are being configured.
  *
  * @see color_scheme_form_validate()
@@ -230,7 +230,7 @@ function color_scheme_form($complete_form, &$form_state, $theme) {
 /**
  * Returns HTML for a theme's color form.
  *
- * @param $variables
+ * @param Array $variables
  *   An associative array containing:
  *   - form: A render element representing the form.
  *
@@ -251,15 +251,15 @@ function theme_color_scheme_form($variables) {
 
   $output  = '';
   $output .= '<div class="color-form clearfix">';
-  // Color schemes
+  // Color schemes.
   $output .= drupal_render($form['scheme']);
-  // Palette
+  // Palette.
   $output .= '<div id="palette" class="clearfix">';
   foreach (element_children($form['palette']) as $name) {
     $output .= drupal_render($form['palette'][$name]);
   }
   $output .= '</div>';
-  // Preview
+  // Preview.
   $output .= drupal_render_children($form);
   $output .= '<h2>' . t('Preview') . '</h2>';
   // Attempt to load preview HTML if the theme provides it.
@@ -459,7 +459,6 @@ function _color_rewrite_stylesheet($theme, &$info, &$paths, $palette, $style) {
     }
     else {
       // Determine the most suitable base color for the next color.
-
       // 'a' declarations. Use link.
       if (preg_match('@[^a-z0-9_-](a)[^a-z0-9_-][^/{]*{[^{]+$@i', $chunk)) {
         $base = 'link';
@@ -568,7 +567,7 @@ function _color_render_images($theme, &$info, &$paths, $palette) {
     imagedestroy($slice);
     $paths['files'][] = $image;
 
-    // Set standard file permissions for webserver-generated files
+    // Set standard file permissions for webserver-generated files.
     drupal_chmod($image);
 
     // Build before/after map of image paths.
@@ -594,7 +593,6 @@ function _color_render_images($theme, &$info, &$paths, $palette) {
 function _color_shift($given, $ref1, $ref2, $target) {
   // We assume that ref2 is a blend of ref1 and target and find
   // delta based on the length of the difference vectors.
-
   // delta = 1 - |ref2 - ref1| / |white - ref1|
   $target = _color_unpack($target, TRUE);
   $ref1 = _color_unpack($ref1, TRUE);
@@ -694,7 +692,7 @@ function _color_hsl2rgb($hsl) {
   $h = $hsl[0];
   $s = $hsl[1];
   $l = $hsl[2];
-  $m2 = ($l <= 0.5) ? $l * ($s + 1) : $l + $s - $l*$s;
+  $m2 = ($l <= 0.5) ? $l * ($s + 1) : $l + $s - $l * $s;
   $m1 = $l * 2 - $m2;
 
   return array(
@@ -709,9 +707,15 @@ function _color_hsl2rgb($hsl) {
  */
 function _color_hue2rgb($m1, $m2, $h) {
   $h = ($h < 0) ? $h + 1 : (($h > 1) ? $h - 1 : $h);
-  if ($h * 6 < 1) return $m1 + ($m2 - $m1) * $h * 6;
-  if ($h * 2 < 1) return $m2;
-  if ($h * 3 < 2) return $m1 + ($m2 - $m1) * (0.66666 - $h) * 6;
+  if ($h * 6 < 1) {
+    return $m1 + ($m2 - $m1) * $h * 6;
+  }
+  if ($h * 2 < 1) {
+    return $m2;
+  }
+  if ($h * 3 < 2) {
+    return $m1 + ($m2 - $m1) * (0.66666 - $h) * 6;
+  }
 
   return $m1;
 }
@@ -735,9 +739,15 @@ function _color_rgb2hsl($rgb) {
 
   $h = 0;
   if ($delta > 0) {
-    if ($max == $r && $max != $g) $h += ($g - $b) / $delta;
-    if ($max == $g && $max != $b) $h += (2 + ($b - $r) / $delta);
-    if ($max == $b && $max != $r) $h += (4 + ($r - $g) / $delta);
+    if ($max == $r && $max != $g) {
+      $h += ($g - $b) / $delta;
+    }
+    if ($max == $g && $max != $b) {
+      $h += (2 + ($b - $r) / $delta);
+    }
+    if ($max == $b && $max != $r) {
+      $h += (4 + ($r - $g) / $delta);
+    }
     $h /= 6;
   }
 
diff --git i/core/modules/color/lib/Drupal/color/Tests/ColorTest.php w/core/modules/color/lib/Drupal/color/Tests/ColorTest.php
index 8902d4c..2bb73ec 100644
--- i/core/modules/color/lib/Drupal/color/Tests/ColorTest.php
+++ w/core/modules/color/lib/Drupal/color/Tests/ColorTest.php
@@ -21,10 +21,13 @@ class ColorTest extends WebTestBase {
    */
   public static $modules = array('color');
 
-  protected $big_user;
+  protected $bigUser;
   protected $themes;
   protected $colorTests;
 
+  /**
+   * Set test information, for the testing page.
+   */
   public static function getInfo() {
     return array(
       'name' => 'Color functionality',
@@ -33,11 +36,14 @@ class ColorTest extends WebTestBase {
     );
   }
 
-  function setUp() {
+  /**
+   * Setup the test, define user, themes and colors.
+   */
+  public function setUp() {
     parent::setUp();
 
     // Create users.
-    $this->big_user = $this->drupalCreateUser(array('administer themes'));
+    $this->bigUser = $this->drupalCreateUser(array('administer themes'));
 
     // This tests the color module in Bartik.
     $this->themes = array(
@@ -49,7 +55,7 @@ class ColorTest extends WebTestBase {
     );
     theme_enable(array_keys($this->themes));
 
-    // Array filled with valid and not valid color values
+    // Array filled with valid and not valid color values.
     $this->colorTests = array(
       '#000' => TRUE,
       '#123456' => TRUE,
@@ -66,20 +72,20 @@ class ColorTest extends WebTestBase {
   /**
    * Tests the Color module functionality.
    */
-  function testColor() {
+  public function testColor() {
     foreach ($this->themes as $theme => $test_values) {
-      $this->_testColor($theme, $test_values);
+      $this->testColorOnTheme($theme, $test_values);
     }
   }
 
   /**
    * Tests the Color module functionality using the given theme.
    */
-  function _testColor($theme, $test_values) {
+  public function testColorOnTheme($theme, $test_values) {
     variable_set('theme_default', $theme);
     $settings_path = 'admin/appearance/settings/' . $theme;
 
-    $this->drupalLogin($this->big_user);
+    $this->drupalLogin($this->bigUser);
     $this->drupalGet($settings_path);
     $this->assertResponse(200);
     $edit['scheme'] = '';
@@ -121,18 +127,18 @@ class ColorTest extends WebTestBase {
   /**
    * Tests whether the provided color is valid.
    */
-  function testValidColor() {
+  public function testValidColor() {
     variable_set('theme_default', 'bartik');
     $settings_path = 'admin/appearance/settings/bartik';
 
-    $this->drupalLogin($this->big_user);
+    $this->drupalLogin($this->bigUser);
     $edit['scheme'] = '';
 
     foreach ($this->colorTests as $color => $is_valid) {
       $edit['palette[bg]'] = $color;
       $this->drupalPost($settings_path, $edit, t('Save configuration'));
 
-      if($is_valid) {
+      if ($is_valid) {
         $this->assertText('The configuration options have been saved.');
       }
       else {
