XWidgetSoft Forum

XWidget & XLaunchpad , Desktop customization
It is currently 2017年 Sep 19日 03:47

All times are UTC - 8 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: 2013年 Oct 23日 07:03 
Offline
User avatar

Joined: 2012年 Jun 10日 05:57
Posts: 315
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 2890 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 8 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:  
cron

Powered by phpBB® Forum Software © phpBB Group