Skip to main content

Label::color

<div id="mw-content-text" lang="en" dir="ltr" class="mw-content-ltr">

<div class="mw-parser-output">

<div class="header" style="background-color: #00baad; color: #FFFFFF; border: 2px solid #00baad;">

<div style="margin: 10px 10px 10px 10px;">

<b>Shared</b>

</div>

</div>

Update the color of the selected label

<h2>

<span class="mw-headline" id="Syntax">Syntax</span>

</h2>

``` Number label.color ```

  • <b>colorR</b> - <b><span style="color:#008017">Number</span></b>

<!-- -->

  • <b>colorG</b> - <b><span style="color:#008017">Number</span></b>

<!-- -->

  • <b>colorB</b> - <b><span style="color:#008017">Number</span></b>

<!-- -->

  • <b>colorAlpha</b> - <b><span style="color:#008017">Number</span></b>

<h2>

<span class="mw-headline" id="Examples">Examples</span><span class="mw-editsection"></span>

</h2>

Updates the color of the label through the command /labelcolor

<div class="header" style="background-color: #408DAE; color: #FFFFFF; border: 2px solid #408DAE;">

<div style="margin: 10px 10px 10px 10px;">

<b>Server-Side</b>

</div>

``` let startLabel = mp.labels.new("Use /labelcolor to update the color of this label.", new mp.Vector3(-431.88, 1146.86, 327), &#123;

   los: false,
   font: 1,
   drawDistance: 100,
   color: [255, 255, 255, 255]

&#125;);

mp.events.addCommand("labelcolor", (player, _, colorR, colorG, colorB, colorAlpha) =&gt; &#123;

  startLabel.color = parseInt(colorR, colorG, colorB, colorAlpha);
  player.outputChatBox(`You have updated the color of the label to: $\&#123;colorR\&#125; $\&#123;colorG\&#125; $\&#123;colorB\&#125; $\&#123;colorAlpha\&#125;`);

&#125;); ```