Home AMX User Forum AMX Design Tools

Change Palettes on the Fly

jjamesjjames Posts: 2,908
Is there any way to change the color palette of a TP on the fly? Does the TP load all the palettes and then selects the active one? Or is the only way to accomplish this to have basically two panels in one? And switch between themes? Has anyone done this for clients who want to be able to change templates/palette colors on the fly?

Comments

  • DHawthorneDHawthorne Posts: 4,584
    The latest version of TPD4 (2.4.0) has a quick palette edit button on the toobar now, assuming you have created multiple palettes for your device and have set up all the buttons and pages to use pallette references for the colors. The dialog for editing hte palettes also allows quick change of the. The new button looks like a little checkerboard with multiple colored squares, or you can get to the same dialog via the menu - Panel | Edit palettes... .

    I have several projects using this feature now, all based on the Panel Designer template Aluminum Smoke. I plan to modify some other designs to work the same way when I get the time; that's the only such template that incorporates this so far. It's a fair amount of work, switching all the color references to a standard palette index, but I feel it will be worth it in the end.
  • jjamesjjames Posts: 2,908
    Dave, thanks for your reply. But what I meant was, can you change the "template", or "palette" or whatever on a live panel - through a SEND_COMMAND to the panel. Meaning, giving the customer the same template (Aluminum Smoke) but allow the choice of say three different "palettes" and the customer can change it on the fly. I'm throwing a second "template", "theme" - whatever you want to call it - on our sandbox panel here, and I can only achieve this by making multiple sets of pages, and just using a page flip to get to the other template. I'm looking for a way to make a palette "active" just like in software, but on the fly.
  • DHawthorneDHawthorne Posts: 4,584
    Ah, that's rather different :).

    I suspect object properties are not stored that way in the panel, and palettes are strictly a TPD4 convention. Each color is most likely a raw RGB value per object, and TPD4 simply references the paleette to send the data to the panel; it doesn't send the palette itself. I say this because there is no palette resource that you can choose from. So the only way to do it on-the-fly with a running panel would be to individually set each page and button property - not terribly practical.
  • jjamesjjames Posts: 2,908
    That's quite "a travesty, a sham, and a mockery." It's "a traveshamockery." :-)

    Not really - it's just that it'd be such a pain in the rear to change all those properties if the customer wanted several color "palettes" on his TP.
  • I'll shed some light on things to break up the conspiracy theory that's hatching. [grin] TPDesign4 does, in fact, send all palettes for a project when trasnfering to a panel, and designates the "active" palette. When a palette entry is used for a color, the index is what is stored in the state's configuration, not the color value itself--both in the TP4 file and on the panel. The multiple palettes feature was added to TPD4 without the need for any firmware changes, which is why you can't currently change palettes on-panel. Without going into any technical details, adding such an ability to the firmware wouldn't be a slam-dunk. But, if it is something that you would really like to see in a future release, I recomment you give Tech Support a call and voice your opinion so the request goes through the proper channels.
  • jjamesjjames Posts: 2,908
    Well now, that's great to know. I'll definately have to voice myself on this to tech support - though, I'd feel quite awkward just calling for a feature request. I'll have to wait until I have a problem and then bring it up. Anyways, let it be known here on here hat I'd LOVE to see it in the next firmware release.

    One last thing - I've been trying to figure out the darn emoticons / smilies that you can use in mid-post. I came across this link, but they don't seem to work.
    http://www.vbulletin.org/forum/misc.php?do=showsmilies

    :banana:
  • [Deleted User][Deleted User] Administrator Posts: 0
    That link is for an old version, see the new smiles:
    http://www.amxforums.com/misc.php?do=showsmilies
    Thanks!
    :D
    :o
    :eek:
  • jjamesjjames Posts: 2,908
    Thanks! No banana dude I see . . . oh well. Thanks again!
  • DHawthorneDHawthorne Posts: 4,584
    This banana dude?
    banana.gif

    :)

    I love the Smiley Xtra extension to Firefox, too bad it seems to have evaporated. It won't update anymore, so I imagine when the links go bad, they are gone unless you host your own.

    Edit: also too bad this version of the forums won't do in-line images, but makes them links intead...
  • KennyKenny Posts: 209
    jjames wrote:
    Well now, that's great to know. I'll definately have to voice myself on this to tech support - though, I'd feel quite awkward just calling for a feature request. I'll have to wait until I have a problem and then bring it up. Anyways, let it be known here on here hat I'd LOVE to see it in the next firmware release.

    One last thing - I've been trying to figure out the darn emoticons / smilies that you can use in mid-post. I came across this link, but they don't seem to work.
    http://www.vbulletin.org/forum/misc.php?do=showsmilies

    :banana:

    Do not feel awkward if you want a feature request. We need to know what it is that you guys want and can sell. The more you say what you want the more likely AMX is to make it.
  • Spire_JeffSpire_Jeff Posts: 1,917
    Kenny wrote:
    Do not feel awkward if you want a feature request. We need to know what it is that you guys want and can sell. The more you say what you want the more likely AMX is to make it.

    My company and I want new keypads. Preferably something similiar to the DMS keypads, but IP based with an updated look. Also, some sort of remote control that is 802.11b/g compatible. I'm sure there are a few other desires we have, but I think I will just create a new thread specifically for product requests :)

    Jeff
  • Spire_JeffSpire_Jeff Posts: 1,917
    This thread seems to have gone a bit off topic (partly my doing). I am wondering if there has been any progress in allowing a palette change via SEND_COMMAND on any of the touchpanels. Even if it couldn't be done from the processor, maybe a selection option in the protected setup???

    Jeff


    I'll shed some light on things to break up the conspiracy theory that's hatching. [grin] TPDesign4 does, in fact, send all palettes for a project when trasnfering to a panel, and designates the "active" palette. When a palette entry is used for a color, the index is what is stored in the state's configuration, not the color value itself--both in the TP4 file and on the panel. The multiple palettes feature was added to TPD4 without the need for any firmware changes, which is why you can't currently change palettes on-panel. Without going into any technical details, adding such an ability to the firmware wouldn't be a slam-dunk. But, if it is something that you would really like to see in a future release, I recomment you give Tech Support a call and voice your opinion so the request goes through the proper channels.
  • Buttons that change colors?

    Has anyone worked with the chameleon buttons? Could this do what you want to do?
  • DHawthorneDHawthorne Posts: 4,584
    B_Clements wrote:
    Has anyone worked with the chameleon buttons? Could this do what you want to do?
    No, chameleon buttons are linked to the current palette. You could always send a discrete color change to individual buttons, but that would (1) break the palette paradigm, and (2) be a heck of a lot of code changing every button in the panel. And it still wouldn't switch out page colors. Whereas a dynamic palette change would switch out everything in a single command.
  • pauldpauld Posts: 106
    DHawthorne wrote:
    Whereas a dynamic palette change would switch out everything in a single command.

    Now that would be Great! I would like to see that.

    Paul
  • Spire_JeffSpire_Jeff Posts: 1,917
    Chameleon images are part of the reason I want to do this. I was playing around with TPD4 and reading up on the Chameleon images and they are a very powerful way to let you quickly customize a panel to match the colors in a house. Basically, you design your graphics using Red and Green. The chameleon image then uses the Fill and Border color to replace the Red and Green colors. The blue color channel is treated as transparent. Also, a lack of color (black) is transparent. Here is a little touchpanel I whipped together with some 10 second button graphics simply to play around with chameleon images and palette changes. (Colors are only choosen for demonstration, not for appeal)

    In the top left section, you see the unaltered PNG files as they are without any changes being applied. These are the graphics that are being used in the right side sections. In the right sections, in each row, all of the buttons are identical in every way except the draw order and each column has the same draw order throughout the column. The top right section uses RGB values for the colors, so they will not change when the palette is changed. The lower right section uses indexed values and they will change as the palette changes. (I included 3 different palettes to play with, or create your own palette :) ) This allows you to create buttons that will have the same color no matter what palette choice is selected without having to create a seperate graphic file for each button.

    Finally, the lower left section is just to demonstrate how a chameleon image is transformed. The Red is replaced with Black (Fill Color), the Green is replaced with White(Border Color) and the blue and black sections are treated as transparent. The interesting thing is the (small) Yellow section. The Yellow (which contains both Red and Green) is the color of the later colors in the draw order. If you draw fill, then border, the Yellow appears White. If you draw border, then fill, the Yellow appears Black. This also applies to the Gradient portion of the button where there is both a Red and a Green value on the pixel. If you switch the fill and border positions in the draw order, you will observe dramatic changes in the appearance of the gradient. This is demonstrated in the right side sections in the first and second columns.

    There is also some transparency being introduced in the gradient. This is why the three rows in each section look different. The shadow images in the top left section are used in the order they appear in each corresponding row of the top and bottom right sections. As you can see, a transparent center to the button on the shadow image allows the brown background to enter the gradient (this could be a good thing). By filling in the section of the button handled by the chameleon image with a White fill, the gradient appears lighter and brighter. By filling in with black, the gradient appears darker and more dim. If you are using anything other than a solid background, I am inclined to reason that using a white or black fill will provide a more uniform appearance to the buttons.

    While setting up a panel with these buttons requires a little more design and work, quickly customizing a panel to the color scheme of the room it is in becomes easy. If there was ever a change to allow palette changes on the fly, panels could change to match the room being controlled, based on the season or holiday, according to current security status, according to the time remaining for the current meeting, ... basically any event without major overhead on the processor (not sure what kind of overhead would be involved on the touchpanels).

    I still need to send this design to actual touchpanels to see if everything holds true in the touchpanel, but I think it will be close.

    Jeff
  • viningvining Posts: 4,368
    Here's a bit of code I made a few years ago that allows all buttons boaders and text colors to change based on the selected back ground image. If you assign all channel buttons the same VT address (providing your not using 'SHO" or other commands) it simplifies things and the ones that can't have the same VT address (like buttons using 'SHO' commands and buttons that actual receive VT) use of the embedded button commands that allow use of button groupings using the 1.100 (1-100 range) make it fairly easy to do and not as much code as you might think. In the code below, I think just 4-6 lines do hundreds of button changes while the rest of the code just changes the back ground image of the main page and the back ground image of the Pop Ups (same back ground) w/ x-y offsets to account for the pop up's position. Sort of an early chameleon effect using images. Of courrse the same thing could be done w/ a variable assigned to hold the color selected from the color picker pop up. These arrays used here are color coordinated to compliment the back ground picture.

    Of course this was for a small system which makes it some what more managable and I only changed main panel pages and pop ups. Module specific Pop Ups with module specific graphics and themes weren't affected. You just change want you want.
    DEFINE_CONSTANT
    ////////////////  BACKGROUND PICTURES AND BUTTONS PICS ////////////////////////
     char cPictureArray [][17] =
        {
        'MoonMan.jpg',
        'Flowers.jpg',
        'Home.jpg',
        'Follow.jpg',
        'Azul.jpg',
        'Ascent.jpg',
        'Autumn.jpg',
        'DiningRoom.jpg',
        'Earth.jpg',
        'MontBush.jpg',
        'Moon.jpg',
        'RedBackground.jpg',
        'Rocket.jpg',
        'Sattelite.jpg',
        'Saturn.jpg',
        'saturn3.jpg',
        'Space1.jpg',
        'space2.jpg',
        'space3.jpg',
        'Blue hills.jpg',
        'Water lilies.jpg',
        'Winter.jpg',
        'Sunset.jpg',
        'Porsche.jpg'
        }
        
    ////////////////////////  BUTTON BORDER AND TEXT COLORS MATCHING PICS ///////////
       char cBTN_Color_Array [][9] =
        {
        '#3C4846FF',//'MoonMan.jpg',
        '#E05343FF',//'Flowers.jpg',
        '#C382A2FF',//'Home.jpg',
        '#OC75D6FF',//'Follow.jpg',
        '#347BA7FF',//'Azul.jpg',
        '#0758BFFF',//'Ascent.jpg',
        '#B86E1BFF',//'Autumn.jpg',
        '#8A9E8AFF',//'DiningRoom.jpg',
        '#4172DAFF',//'Earth.jpg',
        '#603410FF',//'MontBush.jpg',
        '#603410FF',//'Moon.jpg',
        '#9A1727FF',//'RedBackground.jpg',
        '#05081DFF',//'Rocket.jpg',
        '#05081DFF',//'Sattelite.jpg',
        '#05081DFF',//'Saturn.jpg',
        '#05081DFF',//'saturn3.jpg',
        '#05081DFF',//'Space1.jpg',
        '#05081DFF',//'space2.jpg',
        '#05081DFF',//'space3.jpg',
        '#57AEE5FF',//'Blue hills.jpg',
        '#A3F058FF',//'Water lilies.jpg',
        '#B0AAFBFF',//'Winter.jpg',
        '#DC1432FF',//'Sunset.jpg',
        '#D4D092FF' //'#E3E1B8FF' //'Porsche.jpg'
        }
        char cTXT_Color_Array [][9] =
        {
        '#FFFFFFFF',//#3C4846FF',//'MoonMan.jpg',
        '#FFFFFFFF',//'Flowers.jpg',/////
        '#ECE2F5FF',//'Home.jpg',
        '#FCDCABFF',//'Follow.jpg',
        '#F3F7FBFF',//'Azul.jpg',
        '#ECEFFDFF',//'Ascent.jpg',
        '#FAE6C1FF',//'Autumn.jpg',
        '#FAF9EFFF',//'DiningRoom.jpg',/////
        '#FAF9EFFF',//'Earth.jpg',
        '#F9FADBFF',//'MontBush.jpg',
        '#F9FADBFF',//'Moon.jpg',
        '#F9FADBFF',//'RedBackground.jpg',
        '#FFFFFFFF',//'Rocket.jpg',
        '#FFFFFFFF',//'Sattelite.jpg',
        '#FFFFFFFF',//'Saturn.jpg',
        '#FFFFFFFF',//'saturn3.jpg',
        '#FFFFFFFF',//'Space1.jpg',
        '#FFFFFFFF',//'space2.jpg',
        '#FFFFFFFF',//'space3.jpg',
        '#0C0302FB',//'Blue hills.jpg',/////
        '#EACCF0FF',//'Water lilies.jpg',////
        '#FFFFFFFF',//'Winter.jpg',/////
        '#FFFFFFFF',//'Sunset.jpg',////
        '#FFFFFFFF' //'Porsche.jpg'///
        }
        
    
    BUTTON_EVENT[xxxx,yyyy]
    
    push:
    	  {
    	  stack_var 
    	  integer i
    	  integer nX1
    	  integer nY1
    	  integer nMainButton
    	  nMainButton = button.input.channel
    	  to[Button.Input.Device,nMainButton]
    	  select
    	       {
    	       active (nMainButton == 6 || nMainButton == 7)://background down button
    		    {
    		    i = length_array (cPictureArray)
    		    switch (nMainButton)
    			 {
    			 case 6:
    			      {
    			      send_command Button.Input.Device,"'^BMF-312,1 & 2,%JT 0,20,20'"//'nX1,'-',nY1,''"
    			      if (nPics <= i && nPics > 1)
    				   nPics --
    			      else
    				   nPics =  i
    			      }
    			 case 7://background up button
    			      {
    			      send_command Button.Input.Device,"'^BMF-312,1 & 2,%JT 0,365,505'"//'nX1,'-',nY1,''"
    			      if ( nPics >= 1 && nPics < i)
    				   nPics ++
    			      else 
    				   nPics = 1
    			      }
    			 }
    		    send_command button.input.device.number:20:0,"'^BCB-1.110,1,',cBTN_Color_Array [nPics]"//Button Border Color   // AC_TPArray
    		    send_command button.input.device.number:5:0,"'^BCB-1.330,1&2,',cBTN_Color_Array [nPics]"//Button Border Color  //  BnK_TPArray
    		    send_command button.input.device.number:5:0,"'^BCT-1.26 & 40.330,1,',cTXT_Color_Array [nPics]"//[nPics]"//Button Border Color //BnK_TPArray
    		    send_command button.input.device.number:7:0,"'^BCT-1.172,1&2,',cTXT_Color_Array [nPics]"//[nPics]"//Button Border Color //  dvHWI_TPArray
    		    send_command Button.Input.Device,"'^BCB-1.330,1&2,',cBTN_Color_Array [nPics]"//Button Border Color
    		    send_command Button.Input.Device,"'^BCT-1.26 & 40.330,1,',cTXT_Color_Array [nPics]"//[nPics]"//Button Border Color
    		    send_command Button.Input.Device,"'^BMP-299.311 & 313.320,1 & 2,',cPictureArray[nPics]"
    		    send_command Button.Input.Device,"'^JSB-299,1 & 2,0,-95,-125'"
    		    send_command Button.Input.Device,"'^JSB-301,1 & 2,0,-295,-184'"//DVD Transport and Cursor
    		    send_command Button.Input.Device,"'^JSB-302,1 & 2,0,-295,-100'"//Bass
    		    send_command Button.Input.Device,"'^JSB-303,1 & 2,0,-410,-100'"//Loudness
    		    send_command Button.Input.Device,"'^JSB-304,1 & 2,0,-315,-83'"//Sources
    		    send_command Button.Input.Device,"'^JSB-305,1 & 2,0,-355,-100'"//Treble
    		    send_command Button.Input.Device,"'^JSB-306,1 & 2,0,-151,-111'"//Tuner    
    		    send_command Button.Input.Device,"'^JSB-307,1 & 2,0,-242,-193'"//Tuner On
    		    send_command Button.Input.Device,"'^JSB-308,1 & 2,0,-245,-100'"//Video In
    		    send_command Button.Input.Device,"'^JSB-309,1 & 2,0,-190,-100'"//Volume
    		    send_command Button.Input.Device,"'^JSB-310,1 & 2,0,-75,-75'"//HWI Zones
    		    send_command Button.Input.Device,"'^JSB-311,1 & 2,0,-425,-75'"//HWI Scenes
    		    send_command Button.Input.Device,"'^JSB-313,1 & 2,0,-0,-250'"//AVR3805_Sources
    		    send_command Button.Input.Device,"'^JSB-314,1 & 2,0,-0,-0'"//Media Selection
    		    send_command Button.Input.Device,"'^JSB-315,1 & 2,0,-295,-330'"//CD Transport/DVD Transport/Dish
    		    send_command Button.Input.Device,"'^JSB-316,1 & 2,0,-295,-20'"//CD Digits/DVD Cursor/Dish	
    		    send_command Button.Input.Device,"'^JSB-316,1 & 2,0,-295,-20'"//CD Digits/DVD Cursor/Dish	
    		    send_command Button.Input.Device,"'^JSB-317,1 & 2,0,-0,-125'"//CD Digits/DVD Cursor/Dish
    		    }
    
Sign In or Register to comment.