XWidgetSoft Forum

XWidget & XLaunchpad , Desktop customization
It is currently May 2nd, 2025, 5:38 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: October 23rd, 2013, 7:03 am 
Offline
User avatar

Joined: June 10th, 2012, 5:57 am
Posts: 313
Attributes

.font.fill.color
text,edit and memo component font color.
Code:
text1.font.fill.color = rgba(0,0,0,255)  //black
edit1.font.fill.color = rgba(0,0,0,255)  //black
memo1.font.fill.color = rgba(0,0,0,255)  //black


.text.font.fill.color
button and badge component text font color.
Code:
button1.text.font.fill.color = rgba(0,0,0,255)  //black
badge1.text.font.fill.color = rgba(255,128,128,255)  //pink


.background.solidColor.color
all components background solid color.
Code:
image1.background.solidColor.color = rgba(0,255,0,255)  //green
layer1.background.solidColor.color = rgba(150,150,150,255)  //grey
text1.background.solidColor.color = rgba(0,0,255,200)  //blue




Functions
rgba(red,green,blue,alpha)
set color as rgb format.
red,green,blue: integer,0~255. example: black=0,0,0 white=255,255,255 red=255,0,0
alpha:transparency, integer, 0~255.



SelectColor(defaultColor)
select color via colorboard.
Attachment:
color board.png
color board.png [ 126.14 KiB | Viewed 8973 times ]

defaultColor:colorboard will return defaultColor if you click cancel button.
Code:
text1.font.fill.color = selectColor(text1.font.fill.color);
image1.backgroud.solidcolor.color = selectColor( rgba(255,2,2,255) );





getScreenRGB(x,y)
get the color of screen point(x,y).
x,y:screen point.
this function will return string in 255,4,29 form. it doesn't contain the alpha information.
Code:
var rgb_str = getscreenRGB(100,34);
var color_str = rgb_str+ "," + 240; // add alpha to the string
var color = eval(  "rgba(" + color_str + ")"   );
text1.fill.font.color  = color;


to be continued


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 38 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Powered by phpBB® Forum Software © phpBB Group