pocketmine\utils\Color::getColorCode PHP Method

getColorCode() public method

public getColorCode ( )
    public function getColorCode()
    {
        return ($this->red << 16 | $this->green << 8 | $this->blue) & 0xffffff;
    }

Usage Example

示例#1
0
 public function setCustomColor(Color $color)
 {
     if ($hasTag = $this->hasCompoundTag()) {
         $tag = $this->getNamedTag();
     } else {
         $tag = new CompoundTag("", []);
     }
     $tag->customColor = new IntTag("customColor", $color->getColorCode());
     $this->setCompoundTag($tag);
 }