Jump to content

RGB lights


Alluysl

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?)

Link to comment
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.

Link to comment
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:

Link to comment
Share on other sites

On 11/5/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, ? on a button element labeled "Enable Alert!".

</edit>

 

Or .setColorHSL() maybe?

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

Why alpha, do you want transparent lights? xP

Link to comment
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 :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...