The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum
 Origin Forum
 Setting text color via scrpit

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
zknauss Posted - 02/15/2023 : 10:44:20 AM
I'm trying to set the color of text depending on the text components for example:

if(wcol(i)[3]==↑,ColorText(wcol(i)[3],red)

use of the colortext function isn't exactly clear in the origin C manual https://www.originlab.com/doc/en/OriginC/ref/ColorText-ColorText

An alternative option would be to color the text at the point its being generated:

wcol(i)[3]$ =
if(cc[1]>0.01&&cc[1]>=bb[1]&&cc[2]<=bb,↑,

but I'm not sure how to make the output colored

Thanks,

-Zack

ZTK
5   L A T E S T    R E P L I E S    (Newest First)
YimingChen Posted - 02/16/2023 : 11:04:43 AM
If you know the RGB value of the color, you can get the color code by the function color(), e.g. color(20.50.90)=
YimingChen Posted - 02/16/2023 : 10:14:41 AM
You can set the text color in the worksheet cell first, then copy the cell and paste it into the script window. It should give the internal code for the color.

zknauss Posted - 02/16/2023 : 09:59:36 AM
Awesome I'll give it a try just wondering is there a link or way get the code for specific colors?

ZTK
YimingChen Posted - 02/16/2023 : 09:27:00 AM
The OC object method cannot be used in Labtalk script. However, you can try using the following script to set colored text to cells. Please note that the first three lines of the script are used to set the worksheet cells to be rich text.


wproperties execute:=get iotrgui:=tr; 
tr.TextControl.OriginTextControl=1; 
wproperties execute:=set iotrgui:=tr;
col(A)[1]$ = "\c2(A)-\c3(↑)-\c4(↓)";


James
zknauss Posted - 02/15/2023 : 12:54:44 PM
So looking closer at the problem I need to be able to color code the symbols within each cell as detailed in Image 1 so that uppon graphing it give an output like in image 2.


ZTK

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000