Jump to content

Recommended Posts

  • Solution
Posted

Color is actually just converted to a normalized (from zero to one range on each channel) color and brightness like this:

c = color;
intensity = 1.0f;
if (c.r > 1.0f or c.g > 1.0f or c.b > 1.0f)
{
  intensity = Max(c.r, Max(c.g, c.b));
}
if (intensity != 1.0f)
{
  c.r /= i;
  c.g /= i;
  c.b /= i;
}

And this converts normalized color and brightness back to the color:

color.r *= intensity; color.g *= intensity; color.b *= intensity;

In your case, this is all you would need:

light:SetColor(light:GetColor() * 0.5)

 

  • Thanks 1

Let's build cool stuff and have fun. :)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...