pocketmine\utils\Color::getRGB PHP Method

getRGB() public static method

public static getRGB ( $r, $g, $b )
    public static function getRGB($r, $g, $b)
    {
        return new Color((int) $r, (int) $g, (int) $b);
    }

Usage Example

示例#1
0
 public function getCustomColor()
 {
     //
     if ($this->isCustomColor()) {
         $color = $this->namedtag["CustomColor"];
         $green = $color >> 8 & 0xff;
         $red = $color >> 16 & 0xff;
         $blue = $color & 0xff;
         return Color::getRGB($red, $green, $blue);
     }
     return null;
 }