public function luminosityContrast(Color $color): float
    {
        $colorLuminosity1 = $this->getLuminosity() + 0.05;
        $colorLuminosity2 = $color->getLuminosity() + 0.05;

        return max($colorLuminosity1, $colorLuminosity2) / min($colorLuminosity1, $colorLuminosity2);
    }
public function luminosityContrast(Color $color): float
    {
        $colorLuminosity1 = $this->getLuminosity() + 0.05;
        $colorLuminosity2 = $color->getLuminosity() + 0.05;

        return max($colorLuminosity1, $colorLuminosity2) / min($colorLuminosity1, $colorLuminosity2);
    }
public function luminosityContrast ( Color $ color ) : float { $ colorLuminosity1 = $ this -> getLuminosity ( ) + 0.05 ; $ colorLuminosity2 = $ color -> getLuminosity ( ) + 0.05 ; return max ( $ colorLuminosity1 , $ colorLuminosity2 ) / min ( $ colorLuminosity1 , $ colorLuminosity2 ) ; }
Uses the luminosity to calculate the difference between the given colors.
The returned value should be larger than 4.5 for best readability.

@param Color $color

@return float
Uses the luminosity to calculate the difference between the given colors . The returned value should be larger than 4 . 5 for best readability .