Lines Matching refs:weight
417 * @param int|null $weight
430 function mix($color, ?int $weight = 50): ColorRgb
432 if ($weight === null) {
433 $weight = 50;
437 $targetRed = self::round(Math::lerp($color2->getRed(), $this->getRed(), $weight));
438 $targetGreen = self::round(Math::lerp($color2->getGreen(), $this->getGreen(), $weight));
439 $targetBlue = self::round(Math::lerp($color2->getBlue(), $this->getBlue(), $weight));
447 function unmix($color, ?int $weight = 50): ColorRgb
449 if ($weight === null) {
450 $weight = 50;
454 $targetRed = self::round(Math::unlerp($color2->getRed(), $this->getRed(), $weight));
456 throw new ExceptionCompile("This is not possible, the red value ({$color2->getBlue()}) with the percentage $weight could not be unmixed. They were not calculated with color mixing.");
458 $targetGreen = self::round(Math::unlerp($color2->getGreen(), $this->getGreen(), $weight));
460 throw new ExceptionCompile("This is not possible, the green value ({$color2->getGreen()}) with the percentage $weight could not be unmixed. They were not calculated with color mixing.");
462 $targetBlue = self::round(Math::unlerp($color2->getBlue(), $this->getBlue(), $weight));
464 throw new ExceptionCompile("This is not possible, the blue value ({$color2->getBlue()}) with the percentage $weight could not be unmixed. They were not calculated with color mixing.");