merlinvn / controlp5

Automatically exported from code.google.com/p/controlp5
0 stars 0 forks source link

Changing color for first item in ListBox does not work. #31

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
ListBoxItem lbi1 = ListBox.addItem("Test1", 123); lbi.setColorBackground(5000);
lbi.setColorLabel(6000);
ListBoxItem lbi2 = ListBox.addItem("Test2", 456); lbi2.setColorBackground(7000);
lbi2.setColorLabel(8000);

What is the expected output? What do you see instead?
Color is never changed for first item in ListBox. 

What version of the product are you using? On what operating system?
0.5.4 Windows7

Original issue reported on code.google.com by malek.ma...@gmail.com on 17 Jan 2012 at 8:11

GoogleCodeExporter commented 8 years ago
Works with version post 0.5.4
to describe a color do use processing's color function e.g. for red use 
color(255,0,0) or a hex formated color format e.g. 0xffff0000 for red.
To change the caption label of a listbox use 
yourListBox.captionLabel().setColor(0xffff0000);

Original comment by soj...@gmail.com on 18 Jan 2012 at 2:16

GoogleCodeExporter commented 8 years ago
Changed to:
ListBoxItem lbi1 = ListBox.addItem("Test1", 123); 
lbi.setColorBackground(color(255,0,0);
lbi.setColorLabel(color(255,0,0);
ListBoxItem lbi2 = ListBox.addItem("Test2", 456); 
lbi2.setColorBackground(color(0,255,0);
lbi2.setColorLabel(color(0,255,0);

Same results.

Original comment by malek.ma...@gmail.com on 18 Jan 2012 at 7:59

GoogleCodeExporter commented 8 years ago
changes included with version 0.7.0  

Original comment by soj...@gmail.com on 18 Jan 2012 at 9:07