Page 1 of 1

Set color of lamp directly

Posted: Tue Mar 28, 2017 1:44 pm
by Hopewelljnj
Currently you can only set lamp colors by using signals that go into the lamp. These can be customized but still require the implementation of a signal for every color that you wish to use. If it was possible to set lamp color (or tint) directly from LUA, a mod that works with lamp colors, A. Wouldn't need to implement loads of signals, B. Could control everything directly from the lamp. I was attempting to make an RGB lamp mod that would take in 0-255 values for Red, Green, and Blue but found it not possible without direct lamp control. The main reason it's not possible is there is a maximum number of signals that can be added into the game(which is less than every RGB color) . It also would take a serious amount of memory to hold all these signals.

So overall it'd be nice if we had the ability to directly set lamp color/tint from LUA.

Re: Set color of lamp directly

Posted: Tue Mar 28, 2017 10:33 pm
by DaveMcW
You can get a reasonable approximation by rounding every RGB value to multiples of 51. This gives 6 colors per channel, or 216 colors total. This is the basis for the old web safe color palette.