assign color to button or shape

Got an idea, post it here

assign color to button or shape

Postby CaM on Thu Nov 17, 2011 11:38 am

Hi,

it would be nice if I could assign a color (via its hex form) to a button or a shape within an event.

Thanks

Cameron
CaM
 
Posts: 75
Joined: Tue Apr 06, 2004 11:05 am
Location: NZ - living in France

Re: assign color to button or shape

Postby gravy on Thu Nov 24, 2011 10:25 pm

I agree Cameron. I'd like to see that request extended to be able to change all properties of buttons and shapes via events.

I would like to set a number of button and/or shape elements (especially opacity) so i could mimic an Insteon lights dim level.
gravy
 
Posts: 61
Joined: Fri May 30, 2003 12:54 pm
Location: Winnipeg, MB, Canada

Re: assign color to button or shape

Postby PiDD on Sun Nov 27, 2011 5:29 am

yeah that would be perfect.. to be able to set a color or change a graphic by what the insteon light level is would be the pro level touch I am looking for.
PiDD
 
Posts: 89
Joined: Fri Jul 25, 2003 3:04 am

Re: assign color to button or shape

Postby gravy on Mon Nov 28, 2011 7:53 pm

I had actually submitted this as a Mantis request too. Request 938.

Hopefully Steven or Wes can chime in with their thoughts on how hard this would be to implement? I think it has real value.
gravy
 
Posts: 61
Joined: Fri May 30, 2003 12:54 pm
Location: Winnipeg, MB, Canada

Re: assign color to button or shape

Postby wesblack on Tue Nov 29, 2011 12:10 am

Going over this with Steven again....will advise....! :)
wesblack
 
Posts: 852
Joined: Mon Mar 05, 2007 5:02 pm
Location: Valencia, Ca

Re: assign color to button or shape

Postby stevenhanna6 on Thu Dec 01, 2011 4:28 pm

xlobby->"button set opacity" command in latest bleeding edge
stevenhanna6
 
Posts: 904
Joined: Tue Feb 18, 2003 10:39 am
Location: Ontario, Canada

Re: assign color to button or shape

Postby gravy on Thu Dec 01, 2011 5:01 pm

Wonderful, thanks Steven!

I kind of hijacked CaM's request to set color via an event though. Is that possible to implement as well?
gravy
 
Posts: 61
Joined: Fri May 30, 2003 12:54 pm
Location: Winnipeg, MB, Canada

Re: assign color to button or shape

Postby stevenhanna6 on Thu Dec 01, 2011 5:35 pm

Shapes have a color value, but buttons don't. You can change the button image already there is a command for that, I could add a command to shape the color of a shape if that's what you want.
stevenhanna6
 
Posts: 904
Joined: Tue Feb 18, 2003 10:39 am
Location: Ontario, Canada

Re: assign color to button or shape

Postby PiDD on Thu Dec 01, 2011 6:52 pm

Thanks Steven,

Im playing with this now.

I added a circle graphic, a button and text box all with an ID = 'test opacity' and I made them yellow. (just to see what ones the effect will happen on)
I created a couple buttons.. one to set the opacity for 'test opacity' to 20 the other to 222.

When I try both buttons nothing happens?

What am I doing wrong?
PiDD
 
Posts: 89
Joined: Fri Jul 25, 2003 3:04 am

Re: assign color to button or shape

Postby stevenhanna6 on Thu Dec 01, 2011 9:41 pm

you have to use a percentage like 5% or 70% or a variable, new build now shows that.
stevenhanna6
 
Posts: 904
Joined: Tue Feb 18, 2003 10:39 am
Location: Ontario, Canada

Re: assign color to button or shape

Postby gravy on Thu Dec 01, 2011 10:01 pm

stevenhanna6 wrote:Shapes have a color value, but buttons don't. You can change the button image already there is a command for that, I could add a command to shape the color of a shape if that's what you want.


Yes, please! I could make good use of this function too.
gravy
 
Posts: 61
Joined: Fri May 30, 2003 12:54 pm
Location: Winnipeg, MB, Canada

Re: assign color to button or shape

Postby wesblack on Thu Dec 01, 2011 10:53 pm

Example showing 7 Buttons that have individual events to set the bulbs opacity value. The menu has a light bulb image thats not illuminated, another image of the same bulb overlayed on top with the exact same x,y coordinates that using the Button Set Opacity event.

Sample Video+Screenshots

Video

[ Play Quicktime file ] xLobby Button Set Opacity Event.mp4 [ 348.71 KiB | Viewed 17391 times ]



Button Set Opacity Screenshot 1.jpg

Button Opacity Test Menu Screenshot 1

Button Set Opacity Screenshot 2.jpg

Button Opacity Test Menu Screenshot 2, skin editor showing the Button Set Opacity event.
Last edited by wesblack on Thu Dec 01, 2011 11:04 pm, edited 5 times in total.
wesblack
 
Posts: 852
Joined: Mon Mar 05, 2007 5:02 pm
Location: Valencia, Ca

Re: assign color to button or shape

Postby PiDD on Thu Dec 01, 2011 10:56 pm

Works great! This is too cool!
PiDD
 
Posts: 89
Joined: Fri Jul 25, 2003 3:04 am

Re: assign color to button or shape

Postby PiDD on Thu Dec 01, 2011 11:14 pm

Can I tie the opacity level parameter in the event to the slider value variable?

So if my slider variable is %variable>xdimlevel% can I use that for my opacity? I think the answer will be yes but its not working for some reason??
PiDD
 
Posts: 89
Joined: Fri Jul 25, 2003 3:04 am

Re: assign color to button or shape

Postby PiDD on Thu Dec 01, 2011 11:20 pm

arg sorry guys... just to answer my own question... yes, just add a % at the end. %variable>xdimlevel%

Thats twice that little % got me

Can I pass the button id of the button I mouse click to the button id parameter for the opacity command?
PiDD
 
Posts: 89
Joined: Fri Jul 25, 2003 3:04 am

Next