Author Topic: Color importing BGR and not RGB  (Read 2160 times)

Offline jspaulding22

  • Newbie
  • *
  • Posts: 14
    • View Profile
Color importing BGR and not RGB
« on: December 31, 2016, 10:30:38 PM »
I am new to xLights but love it so far. I am a LSP convert. I am going through all the tutorials now fo rnext year.  I am running the 2016.55 version. I have four Coro faces created in my layout. All set as RGB. When I import a LOR file and have the colors set as follows:

1. Mouth = I set the import color as Turquoise (#00ffff) but it imports as Yellow (#ffff00). It is importing the color code backwards.
2. Eyes = Are set to import as Red ( #ff0000) but imports as Blue (#0000ff). This is also backwards
4. Outline = Green (#00ff00) but this is the same forward and backwards, so it can't get this one wrong.

Am I missing some setting here or is this a bug?

Offline Gilrock

  • Supporting Member
  • Hero Member
  • *
  • Posts: 6946
    • View Profile
Re: Color importing BGR and not RGB
« Reply #1 on: January 01, 2017, 08:41:21 AM »
Did you use the force color option for those channels?

Offline jspaulding22

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: Color importing BGR and not RGB
« Reply #2 on: January 01, 2017, 09:21:57 AM »
I believe you are talking about this, correct? See attached

I set the colors in the import and in the Force setting. But it ignores the settings of both.



« Last Edit: January 01, 2017, 09:23:57 AM by jspaulding22 »

Offline jspaulding22

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: Color importing BGR and not RGB
« Reply #3 on: January 01, 2017, 09:32:13 AM »
I am attaching the "Import" file I used and the "xml" file created as I tested this with just one face. You can see that the codes are reversed in the "xml" file compared to the "Import" file.

Offline Gilrock

  • Supporting Member
  • Hero Member
  • *
  • Posts: 6946
    • View Profile
Re: Color importing BGR and not RGB
« Reply #4 on: January 01, 2017, 02:55:46 PM »
Ok  thanks for the file I'll try to run it later.

Offline Gilrock

  • Supporting Member
  • Hero Member
  • *
  • Posts: 6946
    • View Profile
Re: Color importing BGR and not RGB
« Reply #5 on: January 01, 2017, 03:49:30 PM »
So I'm a little unclear what these files are.  The file you calling the "Import" file is that the mapping file?  So I don't actually have any LMS file data right?  Also without the xlights_rgbeffects.xml file and knowing which model you selected I'm not sure I can determine anything.  The target model definition can cause the order of what's being imported to change.  We would reorder the data to match the string type of the target model.

Offline jspaulding22

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: Color importing BGR and not RGB
« Reply #6 on: January 01, 2017, 04:07:57 PM »
Gotcha. Thanks for the education. Sorry, I was referring to the Import file as the mapping file. I will get the terminology down soon, I promise. Here is the LMS file and the xlights_rgbeffects.xml file. Thank you for your help. I have plenty of time until next light season. But wanted to make sure I had an understanding of xlights by going through the tutorials first. Then ran into this minor issue. I really love this software. Tons easier to use. Thanks again.

Offline Gilrock

  • Supporting Member
  • Hero Member
  • *
  • Posts: 6946
    • View Profile
Re: Color importing BGR and not RGB
« Reply #7 on: January 01, 2017, 06:39:25 PM »
Ok it looks like a bug to me but I'm trying to get feedback from other developers that were involved with writing that part of the code.  LOR stores their color data as BGR so we normally do have to flip the bytes around.  It appears to me that we are running the color selected on the import mapping grid through the same function so it's swapping red and blue when that data doesn't have them swapped so it messes it up.  Technically you could swap the red and blue portion of the color you select to fool it until we fix it.

Offline jspaulding22

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: Color importing BGR and not RGB
« Reply #8 on: January 01, 2017, 07:09:27 PM »
At least I am not going crazy. I just went ahead ans swapped colors. I will continue learning and wait for you feedback. Thank you very much for all your help. Tons better than LSP's support right now.

Offline markrvp

  • Full Member
  • ***
  • Posts: 137
    • View Profile
    • My YouTube Channel
Re: Color importing BGR and not RGB
« Reply #9 on: January 03, 2017, 01:27:20 PM »
I'm glad someone else noticed this.  I've had to swap my Red and Blue values in order to get the right color on import.  So, for red, I have to use 0000FF   and for blue I have to use FF0000.  Exactly opposite of what you would expect. 

Offline Gilrock

  • Supporting Member
  • Hero Member
  • *
  • Posts: 6946
    • View Profile
Re: Color importing BGR and not RGB
« Reply #10 on: January 03, 2017, 01:36:04 PM »
I convinced myself it was wrong so I checked in a fix.  I was surprised it hadn't been reported earlier and that's why I almost didn't take the issue seriously.

Offline jspaulding22

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: Color importing BGR and not RGB
« Reply #11 on: January 03, 2017, 07:32:39 PM »
Probably not too many doing imports at this time of the year. Probably taking some time off. I figured I better get an early start since this will be my first xlights year.

markrvp - Thanks for the reinforcements.   ;)