0

I want to control DMX light from a higher system. I receive only RGB values 0-255. DMX light have RED, GREEN, BLUE and AMBER light (0-255). How can i convert RGB to RGB + Amber?

I tried manually adjust the light, but the conversion table is not an option for me, because i have limited memory. Thanks. R

niktoss
  • 51
  • 4
  • Isn't amber just an additional color channel? I guess it's simply 0 when you only get RGB values. Or does the output color differ to your input RGB? – Youka Sep 08 '15 at 16:38
  • 3
    I love that they refer to these lamps as RGBA. I'm still trying to picture a light with an alpha channel... – tux3 Sep 08 '15 at 16:43
  • 1
    Did you found any way to do it ? – Kevin Vacquier Jun 23 '17 at 10:06
  • 2
    I'm voting to close this question as off-topic because this is not a programming question as defined in the Help Center. – Rob Dec 06 '19 at 15:37

3 Answers3

3

In light, there are different color spaces. Each color space is a dimensional space such that combining colors along the "dimension" will result in a mixed color.

RGB, means that you get to mix various values of Red, Green, and Blue. Amber is already a mixture, so to "add Amber" to RGB, you have to decide how to adjust the Red, Green, and Blue values such that they seem a bit more Amber.

Amber is #FFBF00 or (RGB: 255, 191, 0), so the first step would be to figure out how much of "Amber" a RGB value is. For example, (RGB: 128, 80, 0) is 50% Amber and 0% everything else.

Once you can figure out the Amber percentage, you can "pull out the Amber" leaving the rest of the non-amber color in RGB. Then you can have a RGBAmber color space.

Keep in mind that you can't over-drive RGB, so if you add (RGBAmber: 50%, 20%, 0%, 100%) it will be converted to RGB(100%, ...) which won't let the red scale up as much as the other colors, making the amber things seem a bit off.

In reality, this will properly approximate the construction of the fourth amber dimension; but, it won't be correct. The truth is that you cannot fully construct the fourth dimension from the other three because the Red Green and Blue physically mix differently than the Amber channel produces. For example, it is fully valid to drive RGBAmber at 100% across all channels, but RGB could never do that, as to drive amber at 100% you would effectively zero out all of your red channel.

Edwin Buck
  • 69,361
  • 7
  • 100
  • 138
1

Amber LEDs have different spectra from red, green, blue, and white LEDs. There is no RGB --> RGBA conversion, because you will end up with a different spectrum of lighting than if you had used RGB LEDs alone.

Side note: amber LEDs are typically quite dim in comparison to red and green, so if you're just trying to produce light that "looks" yellow to our eyes, you can just ignore the amber channel of your DMX light without sacrificing much on total brightness.

chloelle
  • 332
  • 3
  • 12
0

Amber is #FFBF00 or (RGB: 255, 191, 0)

char amber = (floor(255.0f*(R*1.0f+G*.749f)/446.0f))

this part of the calculation performs the amber scaling:

(R*1.0f+G*.749f)/446.0f)  and results in a value range 0.0f...1.0f

this part of the calculation performs the scaling to 0...255

255.0f*

this part of the calculation eliminates the fraction

(floor(....)

in all probability the range produced will be 0...254, but that should be close enough to keep it simple and usable

user3629249
  • 16,402
  • 1
  • 16
  • 17