diff --git a/src/ColorRGB.php b/src/ColorRGB.php
index 529c5e9..ef1dfc3 100644
--- a/src/ColorRGB.php
+++ b/src/ColorRGB.php
@@ -89,9 +89,9 @@ class ColorRGB extends ColorBase {
    *   The color in format: #RRGGBB
    */
   public function toString(bool $opacity = TRUE): string {
-    $output = $opacity
-        ? 'rgba(' . $this->getRed() . ',' . $this->getGreen() . ',' . $this->getBlue() . ',' . $this->getOpacity() . ')'
-        : 'rgb(' . $this->getRed() . ',' . $this->getGreen() . ',' . $this->getBlue() . ')';
+    $output = $opacity && $this->getOpacity() !== 1.0
+        ? 'rgb(' . $this->getRed() . ' ' . $this->getGreen() . ' ' . $this->getBlue() . ' / ' . $this->getOpacity() . ')'
+        : 'rgb(' . $this->getRed() . ' ' . $this->getGreen() . ' ' . $this->getBlue() . ')';
 
     return strtolower($output);
   }
