Jump to content
Sign in to follow this  
Alluysl

RGB lights

Recommended Posts

So if data links can carry non-binary information (which I think they can, for screens for example), why not having a light with three inputs for 8-bit values (integers between 0 and 255), one for red, one for green and one for blue? We could have the lighting changing depending on the situation, for example red if the base is attacked or green the day and blue the night (light detectors btw?)

Share this post


Link to post
Share on other sites

I'm not too sure if data links only carry binary information. I'm sure that if they don't NQ will just let you make your own functions in lua for this kind of thing.

Share this post


Link to post
Share on other sites

I like the general idea :)

 

But I don't think we need three inputs. LUA scripting should be way more sophisticated than wasting 3 connectors for 24bit color settings. I guess if this will be realized, we'd rather get proper light setting methods for the LUA object on the DPU ^_^

 

for key,value in pairs(self.StatusLights) do
    self.StatusLights[key].setColorRGB(230, 32, 8)
end

 

<edit>

Regarding the code: to change the color of all your status related illumination, you'd first add all those lights to a table and then use a method to go through all of them and set the color. I've put fixed values for RGB above, but you could pass them as arguments to your method and use something like self.SetStatusLightRGB(230, 32, 8) on a button element labeled "Enable Alert!".

</edit>

 

Or .setColorHSL() maybe?

What happens on .setColorRGBA() then? Do we get octarine!? :lol:

Share this post


Link to post
Share on other sites
On 05/11/2017 at 1:04 AM, vertex said:

I like the general idea :)

 

But I don't think we need three inputs. LUA scripting should be way more sophisticated than wasting 3 connectors for 24bit color settings. I guess if this will be realized, we'd rather get proper light setting methods for the LUA object on the DPU ^_^

 


for key,value in pairs(self.StatusLights) do
    self.StatusLights[key].setColorRGB(230, 32, 8)
end

 

<edit>

Regarding the code: to change the color of all your status related illumination, you'd first add all those lights to a table and then use a method to go through all of them and set the color. I've put fixed values for RGB above, but you could pass them as arguments to your method and use something like self.SetStatusLightRGB(230, 32, 8) on a button element labeled "Enable Alert!".

</edit>

 

Or .setColorHSL() maybe?

What happens on .setColorRGBA() then? Do we get octarine!? :lol:

Why alpha you want transparent lights? x)

Share this post


Link to post
Share on other sites

Yarr! :D

 

But seriously - alpha could be applied to other elements, like screens or windows, too. Next thought: from a technical perspective it would work for lights too - reducing alpha on light radiation would enable us to "fake" the "lightness" part of HSL in RGBA, because alpha would serve a similar idea as lightness, at least keeping the hue the same.

 

To calculate a soft pulse for three channels is more work than just shifting alpha up and down, always using the same values for RGB. If alpha on light-emitting elements doesn't work out engine-wise, one could always translate the fourth channel internally - or just not add this method to the LUA object of these DPUs.

 

But maybe they'll just go for setPower() with a 0 to 1 factor. Or 0 to 255. Or 0% to 100%. Alpha, power, lightness... in the end the results are similar for light emitters :)

Share this post


Link to post
Share on other sites

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.

Loading...
Sign in to follow this  

×
×
  • Create New...