The color codes are optimized only when the output style is set to compressed.
// style.scss
$primary-color: #444;
$secondary-color: #ffffff;
.test {
background: $primary-color;
color: $secondary-color;
}
compiled with the command sass -t compressed style.scss style.css
produce the following file:
// style.css
.test{background:#444;color:#fff}