Lines Matching refs:ColorRgb

18 class ColorRgb
278 * @return ColorRgb - the default primary color in case of any errors
281 public static function getDefaultPrimary(): ColorRgb
309 public static function createFromRgbChannels(int $red, int $green, int $blue): ColorRgb
311 return (new ColorRgb())
319 public static function getWhite(): ColorRgb
322 return (new ColorRgb())
332 public static function getBlack(): ColorRgb
336 return (new ColorRgb())
349 public static function createFromHex(string $color): ColorRgb
352 return (new ColorRgb())
416 * @param array|string|ColorRgb $color
418 * @return ColorRgb
430 function mix($color, ?int $weight = 50): ColorRgb
436 $color2 = ColorRgb::createFromString($color);
440 return ColorRgb::createFromRgbChannels($targetRed, $targetGreen, $targetBlue);
447 function unmix($color, ?int $weight = 50): ColorRgb
453 $color2 = ColorRgb::createFromString($color);
466 return ColorRgb::createFromRgbChannels($targetRed, $targetGreen, $targetBlue);
548 static function createFromString(string $color): ColorRgb
561 static function createFromName(string $color): ColorRgb
563 return (new ColorRgb())
626 function shade(int $percentage): ColorRgb
648 function scale(int $percentage): ColorRgb
673 function tint(int $percentage): ColorRgb
706 * @param ColorRgb $colorRgb
711 function getContrastRatio(ColorRgb $colorRgb): float
732 function toMinimumContrastRatio(string $color, float $minimum = self::MINIMUM_CONTRAST_RATIO, $darknessIncrement = 5): ColorRgb
734 $targetColor = ColorRgb::createFromString($color);
753 function complementary(): ColorRgb
781 function toMinimumContrastRatioAgainstWhite(float $minimumContrastRatio = self::MINIMUM_CONTRAST_RATIO, int $darknessIncrement = 5): ColorRgb
790 function setHex(string $color): ColorRgb
806 function setRgbChannels(array $colorValue): ColorRgb
827 function setNameType(string $type): ColorRgb
837 function setName(string $name): ColorRgb
847 case ColorRgb::PRIMARY_VALUE:
850 if ($primaryColor !== ColorRgb::PRIMARY_VALUE) {
856 case ColorRgb::SECONDARY_VALUE:
859 if ($secondaryColor !== ColorRgb::SECONDARY_VALUE) {