public function setColor($red = null, $green = null, $blue = null)
    {
        $deferred = new Deferred();

        if (is_null($red)) {
            $this->setAttribute('color', 0);

            $deferred->resolve();

            return $deferred->promise();
        }

        $this->setAttribute('color', $red * 16 ** 4 + $green * 16 ** 2 + $blue);

        $deferred->resolve();

        return $deferred->promise();
    }