<commit_before><?php

/**
 * This file is part of the Rainbow package.
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 *
 * @license MIT License
 */

namespace Rainbow\Calculation\Blending;

use Rainbow\Rgb;

final class Screen
{
    /**
     * @var Rgb
     */
    private $result;

    /**
     * @param Rgb $color1
     * @param Rgb $color2
     */
    public function __construct(Rgb $color1, Rgb $color2)
    {
        $redSum     = $color1->getRed()->getValue() + $color2->getRed()->getValue() ;
        $greenSum   = $color1->getGreen()->getValue() + $color2->getGreen()->getValue();
        $blueSum    = $color1->getBlue()->getValue() + $color2->getBlue()->getValue();
        $multiply   = new Multiply($color1, $color2);
        $multiplied = $multiply->result();

        $this->result = new Rgb(
            abs($redSum - $multiplied->getRed()->getValue()),
            abs($greenSum - $multiplied->getGreen()->getValue()),
            abs($blueSum - $multiplied->getBlue()->getValue())
        );
    }

    /**
     * @return Rgb
     */
    public function result()
    {
        return $this->result->copy();
    }
}
<commit_msg>Screen class implements calculation interface<commit_after><?php

/**
 * This file is part of the Rainbow package.
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 *
 * @license MIT License
 */

namespace Rainbow\Calculation\Blending;

use Rainbow\Calculation\CalculationInterface;
use Rainbow\Rgb;

final class Screen implements CalculationInterface
{
    /**
     * @var Rgb
     */
    private $result;

    /**
     * @param Rgb $color1
     * @param Rgb $color2
     */
    public function __construct(Rgb $color1, Rgb $color2)
    {
        $redSum     = $color1->getRed()->getValue() + $color2->getRed()->getValue() ;
        $greenSum   = $color1->getGreen()->getValue() + $color2->getGreen()->getValue();
        $blueSum    = $color1->getBlue()->getValue() + $color2->getBlue()->getValue();
        $multiply   = new Multiply($color1, $color2);
        $multiplied = $multiply->result();

        $this->result = new Rgb(
            abs($redSum - $multiplied->getRed()->getValue()),
            abs($greenSum - $multiplied->getGreen()->getValue()),
            abs($blueSum - $multiplied->getBlue()->getValue())
        );
    }

    /**
     * @return Rgb
     */
    public function result()
    {
        return $this->result->copy();
    }
}

{'fraction_non_alphanumeric': 0.15886026541764248, 'fraction_numerical': 0.00936768149882904, 'mean_word_length': 2.515775034293553, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 47, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4322236', 'n_tokens_mistral': 766, 'n_tokens_neox': 755, 'n_words': 178}