diff --git a/core/modules/color/color.admin-rtl.css b/core/modules/color/color.admin-rtl.css
index d5bfbe8..2e58f07 100644
--- a/core/modules/color/color.admin-rtl.css
+++ b/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 a/core/modules/color/color.admin.css b/core/modules/color/color.admin.css
index e9aee91..5b5c156 100644
--- a/core/modules/color/color.admin.css
+++ b/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 a/core/modules/color/color.module b/core/modules/color/color.module
index d4ca6ca..58837d7 100644
--- a/core/modules/color/color.module
+++ b/core/modules/color/color.module
@@ -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,8 +593,7 @@ 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|
+  // delta = 1 - |ref2 - ref1| / |white - ref1|.
   $target = _color_unpack($target, TRUE);
   $ref1 = _color_unpack($ref1, TRUE);
   $ref2 = _color_unpack($ref2, 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 a/core/modules/color/preview.html b/core/modules/color/preview.html
index e25b7ad..3fe2cac 100644
--- a/core/modules/color/preview.html
+++ b/core/modules/color/preview.html
@@ -4,4 +4,4 @@
     <p>Sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud <a href="#">exercitation ullamco</a> laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
   </div>
   <div id="img"></div>
-</div>
\ No newline at end of file
+</div>
