[
Code: Select all
[MeasureActive1]
Measure=Calc
Formula=#CurrentFeed#=1
DynamicVariables=1
Group=FeedData | Tab2
Disabled=1
Code: Select all
[MeasureActive1]
Measure=Calc
Formula=#CurrentFeed#=1
DynamicVariables=1
Group=FeedData | Tab2
Disabled=1
I see now what is wrong with it. It's not about my code (which was tested against [MeasureActive1] using a reddish image, so I know it works) or balala's. You need to tell us exactly what measure provides those "$1400.00" and "$0" values. In other words, what measure you want to test against that 0 value and stuff.tjhuntley wrote: ↑March 28th, 2020, 10:20 am Thanks. I don't know much about the code but again, I am learning from you guys. I tried to replace this:
[With what Yincognito sent. I also tried what balala said but I feel like I am doing something wrong. After trying to figure it out I thought maybe the feed was part of the problem, and I think it was but there has to be another. My feed wasn't a pure number. Instead of "1400" and "0" the feed was actually "$1400.00" and "$0". I changed the feed to 1400 and tried everything again but I am still getting the original White Gcal.W.png. I added the Gcal.R.png to the same folder, but can't figure out what I am doing wrong.Code: Select all
[MeasureActive1] Measure=Calc Formula=#CurrentFeed#=1 DynamicVariables=1 Group=FeedData | Tab2 Disabled=1
Yes, indeed. In this case, more than any other, there are a million ways to achieve the desired result. Rainmeter provides a lot of ways of altering colors in a meter or an image, and there is also the possibility of changing the ImageName option, so lots of ways to eat a cookie, so to speak.balala wrote: ↑March 28th, 2020, 9:46 am Another possible approach to apply different colors to an image is to recolor the image through ColorMatrix options. Not a simple and obvious possibility, but it is one.
The easiest way we to help you, is to pack the whole config you have and upload the resulting package. This way we'd have all needed files in order to can test the skin (for instance Reader.lua, Tabs.lua and the image which has to be recolored). Beside this, Yincognito is right when he says that:
No one will figure out which is the measure we should work with, especially that we can't test your code.Yincognito wrote: ↑March 28th, 2020, 11:12 am You need to tell us exactly what measure provides those "$1400.00" and "$0" values. In other words, what measure you want to test against that 0 value and stuff.
I already mentioned what skin the OP is using, it's Google Calendar. The Lua files are there, in the skin (i.e. @Resources\Measures folder). Or, are you talking about the modifications he made to those files? Cause, you know, I doubt the OP made any modification to the Lua files, since he's a beginner in Rainmeter code in the first place, let alone Lua...
Oh, sorry, I missed this detail in meantime. Yep, now I we have the skin to test. Yes, I also believe there are no relevant modifications.Yincognito wrote: ↑March 28th, 2020, 12:45 pm I already mentioned what skin the OP is using, it's Google Calendar. The Lua files are there, in the skin (i.e. @Resources\Measures folder). Or, are you talking about the modifications he made to those files? Cause, you know, I doubt the OP made any modification to the Lua files, since he's a beginner in Rainmeter code in the first place, let alone Lua...
Because before identifying the skin (after reading your reply), had no idea about how the skin is working. Saw the Script measures with the .lua files and thought they are needed to can work with the skin and could identify the measure which we have to work with. And they indeed are, right?Yincognito wrote: ↑March 28th, 2020, 12:45 pm Just trying to understand how not having those files (even though they exist in the skin, probably unaltered) is preventing debugging the OP's process. I may be missing something here, maybe?
Yes, the question is still there, indeed. I'm not sure we could identify the measure producing the values the OP wants to be tested, as none of those measures are yielding something close to "$1400.00" and such. Unless, of course, he added some events in his actual (i.e. the online service, not the skin) Google calendar (that the Lua measures may be retrieving), along the lines of "Today, 28.03.2020, I have to give my employee John his income of $1400.00 and thank him for the good job he's done" (just an example)...balala wrote: ↑March 28th, 2020, 1:17 pm Oh, sorry, I missed this detail in meantime. Yep, now I we have the skin to test. Yes, I also believe there are no relevant modifications.
But the same question what both you and me have asked is still there: what is the measure we should work with? Can't identify it...
Because before identifying the skin (after reading your reply), had no idea about how the skin is working. Saw the Script measures with the .lua files and thought they are needed to can work with the skin and could identify the measure which we have to work with. And they indeed are, right?
Yep, we'll have to wait for his reply, to let us know the relevant detail...Yincognito wrote: ↑March 28th, 2020, 1:36 pm Yes, the question is still there, indeed. I'm not sure we could identify the measure producing the values the OP wants to be tested, as none of those measures are yielding something close to "$1400.00" and such. Unless, of course, he added some events in his actual (i.e. the online service, not the skin) Google calendar (that the Lua measures may be retrieving), along the lines of "Today, 28.03.2020, I have to give my employee John his income of $1400.00 and thank him for the good job he's done" (just an example)...
You have only 1 text item showing [ItemWhat1] and that text value is #Item1Title# coming from the Reader.lua script. The color of the icon is based on the Enigma theme colors ('W' or 'B'), so you will need to tint the icon rather than change it's color.tjhuntley wrote: ↑March 25th, 2020, 11:58 am I guess I should have said calendar because I am doing a workaround to get the spreadsheet's info onto my desktop. I am using Google Sheets and sending the info to my Google Calendar and then I have modified the Gcal meter to get the info.
That is EXACTLY what I need above. I have tried to add this to my existing code but I have limited knowledge of Rainmeter and how it works. If you have time, maybe you can tell me if there is something in my code preventing this from changing to red when the value goes above zero... Here is the code I am using:
Code: Select all
[Rainmeter] MiddleMouseUpAction=!Refresh LeftMouseDoubleClickAction=!ActivateConfig #CURRENTCONFIG# [Variables] ;----------------------- ; FEEDS ; GoogleCalendar1=https://calendar.google.com/calendar/ical/.../full.ics GoogleCalendar1=https://calendar.google.com/calendar/ical/cduyrrt80kkabc123abc123abc123%33group.calendar.google.com/private-31555abv67yyyyabc123abc123abc123/basic.ics ;-------------------------------------------------------------------------------------------- ; ENIGMA DARK Color1=255,255,255 Color2=#Color1#,160 Color3=#Color1#,108 Color4=#Color1#,25 ColorLink=128,192,255 ColorLink2=#ColorLink#,217 ColorLink3=#ColorLink#,160 ColorBorder=192, 192, 192 ColorBorder2=#ColorBorder#, 128 ColorBorder3=#ColorBorder#, 92 ColorBorder4=#ColorBorder#, 64 ColorPanel=24,24,24 ColorPanel2=#ColorPanel#,128 ColorFilter=0,0,0 ColorFilter2=#ColorFilter#,192 ColorFilter3=#ColorFilter#,128 ColorEvent=255,0,0 ColorEvent2=#ColorEvent#,92 ColorTransparent=0,0,0,2 ColorImage=W Size1=23 Size4=11 Size3=9 Size2=10 Font=Open Sans SkinBackgroundAlpha=0 HideBordersTop=1 HideBordersBottom=1 SidebarWidth=275 SidebarSpacingFixed=1 SidebarAlpha=128 SidebarImage=#@#Images\Sidebar\SidebarLeft.#ColorImage#.jpg SecondSidebarImage=#@#Images\Sidebar\SidebarRight.#ColorImage#.jpg ;----------------------- ; GENERAL TriptychInterval=30 TriptychDisabled=0 ProcessInterval=5 SkinMouseOver=0 Reset=1 SwitcherInterval=30 SwitcherDisabled=0 SwitcherInterval=#TriptychInterval# SwitcherAction=!CommandMeasure "MeasureScriptReader" "ShowNext()" SwitcherDisabled=#TriptychDisabled# GoogleCalendarWriteEvents=0 CurrentFeed=1 ; 1~3 tabs NumberOfTabs=1 ; 1~8 items NumOfItems=8 ReaderURL1=#GoogleCalendar1#?futureevents=true&singleevents=true&orderby=starttime&sortorder=a ReaderURL2=#GoogleCalendar2#?futureevents=true&singleevents=true&orderby=starttime&sortorder=a ReaderURL3=#GoogleCalendar3#?futureevents=true&singleevents=true&orderby=starttime&sortorder=a ReaderUpdateRate=60 ReaderWriteEvents=#GoogleCalendarWriteEvents# ReaderEventFile=#@#User\Calendars\GoogleCalendar1.xml|#@#User\Calendars\GoogleCalendar2.xml|#@#User\Calendars\GoogleCalendar3.xml FeedTitle=Loading... Item1Title= Item1Date= ; WebParserSubstitute="<![CDATA[":"","]]>":"","/PRE>":"","PRE>":""," ":" ","'s Facebook Notifications":"","Top Stories - Google ":"" ; Alternate substitution WebParserSubstitute="<![CDATA[":"","]]>":"","/PRE>":"","PRE>":""," ":" ","'s Facebook Notifications":"","Top Stories - Google ":"",""":'"',"&":"&","'":"'","<":"<",">":">"," ":" ","¡":"¡","¢":"¢","£":"£","¤":"¤","¥":"¥","¦":"¦","§":"§","¨":"¨","©":"©","ª":"ª","«":"«","¬":"¬","­":" ","®":"®","¯":"¯","°":"°","±":"±","²":"²","³":"³","´":"´","µ":"µ","¶":"¶","·":"·","¸":"¸","¹":"¹","º":"º","»":"»","¼":"¼","½":"½","¾":"¾","¿":"¿","À":"À","Á":"Á","Â":"Â","Ã":"Ã","Ä":"Ä","Å":"Å","Æ":"Æ","Ç":"Ç","È":"È","É":"É","Ê":"Ê","Ë":"Ë","Ì":"Ì","Í":"Í","Î":"Î","Ï":"Ï","Ð":"Ð","Ñ":"Ñ","Ò":"Ò","Ó":"Ó","Ô":"Ô","Õ":"Õ","Ö":"Ö","×":"×","Ø":"Ø","Ù":"Ù","Ú":"Ú","Û":"Û","Ü":"Ü","Ý":"Ý","Þ":"Þ","ß":"ß","à":"à","á":"á","â":"â","ã":"ã","ä":"ä","å":"å","æ":"æ","ç":"ç","è":"è","é":"é","ê":"ê","ë":"ë","ì":"ì","í":"í","î":"î","ï":"ï","ð":"ð","ñ":"ñ","ò":"ò","ó":"ó","ô":"ô","õ":"õ","ö":"ö","÷":"÷","ø":"ø","ù":"ù","ú":"ú","û":"û","ü":"ü","ý":"ý","þ":"þ","ÿ":"ÿ","Œ":"Œ","œ":"œ","Š":"Š","š":"š","Ÿ":"Ÿ","ƒ":"ƒ","ˆ":"ˆ","˜":"˜","Α":"?","Β":"?","Γ":"G","Δ":"?","Ε":"?","Ζ":"?","Η":"?","Θ":"T","Ι":"?","Κ":"?","Λ":"?","Μ":"?","Ν":"?","Ξ":"?","Ο":"?","Π":"?","Ρ":"?","Σ":"S","Τ":"?","Υ":"?","Φ":"F","Χ":"?","Ψ":"?","Ω":"O","α":"a","β":"ß","γ":"?","δ":"d","ε":"e","ζ":"?","η":"?","θ":"?","ι":"?","κ":"?","λ":"?","μ":"µ","ν":"?","ξ":"?","ο":"?","π":"p","ρ":"?","ς":"?","σ":"s","τ":"t","υ":"?","φ":"f","χ":"?","ψ":"?","ω":"?","ϑ":"?","ϒ":"?","ϖ":"?"," ":" "," ":" "," ":" ","‌":" ","‍":" ","‎":" ","‏":" ","–":"–","—":"—","‘":"‘","’":"’","‚":"‚","“":"“","”":"”","„":"„","†":"†","‡":"‡","•":"•","…":"…","‰":"‰","′":"'","″":"?","‹":"‹","›":"›","‾":"?","⁄":"/","€":"€","ℑ":"I","℘":"P","ℜ":"R","™":"™","ℵ":"?","←":"?","↑":"?","→":"?","↓":"?","↔":"?","↵":"?","⇐":"?","⇑":"?","⇒":"?","⇓":"?","⇔":"?","∀":"?","∂":"?","∃":"?","∅":"Ø","∇":"?","∈":"?","∉":"?","∋":"?","∏":"?","∑":"?","−":"-","∗":"*","√":"v","∝":"?","∞":"8","∠":"?","∧":"?","∨":"?","∩":"n","∪":"?","∫":"?","∴":"?","∼":"~","≅":"?","≈":"˜","≠":"?","≡":"=","≤":"=","≥":"=","⊂":"?","⊃":"?","⊄":"?","⊆":"?","⊇":"?","⊕":"?","⊗":"?","⊥":"?","⋅":"·","⋮":"?","⌈":"?","⌉":"?","⌊":"?","⌋":"?","⟨":"<","⟩":">","◊":"?","♠":"?","♣":"?","♥":"?","♦":"?" ;--------------------------------------------------------------------- ; STYLES [StyleReaderText] ;*SLIDES TEXT LEFT AND RIGHT* Meter=String StringAlign=Center X=37 ClipString=1 StringStyle=NORMAL FontColor=#Color1# FontSize=#Size3# FontFace=#Font# AntiAlias=1 DynamicVariables=1 [StyleReaderTextSubheading] ;*CHANGE LINE SPACING* Y=23r ;*ITALIC OR BOLD* StringStyle=NORMAL [StyleReaderTextFirst] ;*SLIDES ALL TEXT UP AND DOWN* Y=47 [StyleReaderSubtext] X=22 Y=14r H=14 W=(#SidebarWidth#-34) ClipString=1 StringStyle=NORMAL FontColor=#Color2# FontSize=#Size4# FontFace=#Font# AntiAlias=1 ToolTipWidth=#SidebarWidth# DynamicVariables=1 ;----------------------- ; GRABBERS [StyleReaderGrabber] X=R Y=r H=15 W=15 DynamicVariables=1 [StyleReaderGrabberFirst] X=(#SidebarWidth#-(#NumberOfTabs#*15)-10) Y=-7r [StyleReaderGrabber0] ImageName=#@#Images\Grabber.#ColorImage#.png ImageAlpha=128 ToolTipWidth=#SidebarWidth# ToolTipText=Click to switch to this page. [StyleReaderGrabber1] ImageName=#@#Images\GrabberActive.#ColorImage#.png ;--------------------------------------------------------------------- ; MEASURES ;----------------------- [MeasureScriptReader] Measure=Script ScriptFile="#@#Measures\Reader.lua" MeasureName=MeasureFeed1 MinItems=#NumOfItems# WriteEvents=#ReaderWriteEvents# EventFile=#ReaderEventFile# FinishAction=[!UpdateMeasureGroup "FeedData"][!UpdateMeterGroup "FeedData"][!Redraw][!SetVariable Reset 0] [MeasureActivateTabs] Measure=Script ScriptFile=#@#Measures\Tabs.lua UpdateDivider=-1 Type=Reader TotalTabs=1 [MeasureFeed1] Measure=Plugin Plugin=WebParser UpdateRate=#ReaderUpdateRate# URL=#ReaderURL1# RegExp=(?siU)(.*)$ DecodeCharacterReference=1 Substitute=#WebParserSubstitute# FinishAction=!CommandMeasure MeasureScriptReader Refresh(1) [MeasureFeed2] Measure=Plugin Plugin=WebParser UpdateRate=#ReaderUpdateRate# URL=#ReaderURL2# RegExp=(?siU)(.*)$ DecodeCharacterReference=1 Substitute=#WebParserSubstitute# FinishAction=!CommandMeasure MeasureScriptReader Refresh(2) Group=Tab2 Disabled=1 [MeasureFeed3] Measure=Plugin Plugin=WebParser UpdateRate=#ReaderUpdateRate# URL=#ReaderURL3# RegExp=(?siU)(.*)$ DecodeCharacterReference=1 Substitute=#WebParserSubstitute# FinishAction=!CommandMeasure MeasureScriptReader Refresh(3) Group=Tab3 Disabled=1 [MeasureActive1] Measure=Calc Formula=#CurrentFeed#=1 DynamicVariables=1 Group=FeedData | Tab2 Disabled=1 [MeasureActive2] Measure=Calc Formula=#CurrentFeed#=2 DynamicVariables=1 Group=FeedData | Tab2 Disabled=1 [MeasureActive3] Measure=Calc Formula=#CurrentFeed#=3 DynamicVariables=1 Group=FeedData | Tab3 Disabled=1 ;--------------------------------------------------------------------- ; METERS [Background] Meter=IMAGE ImageName=#@#Images\SkinBackground.#ColorImage#.png ScaleMargins=12,12,12,12 ImageAlpha=1 MouseOverAction=[!SetOption #CURRENTSECTION# ImageAlpha #SkinBackgroundAlpha#][!UpdateMeter #CURRENTSECTION#][!Redraw] MouseLeaveAction=[!SetOption #CURRENTSECTION# ImageAlpha 1][!UpdateMeter #CURRENTSECTION#][!Redraw] W=#SidebarWidth# H=(39 * #NumOfItems#) [Border] Meter=IMAGE SolidColor=#ColorBorder4# X=10 Y=0 W=(#SidebarWidth#-26) H=1 Hidden=#HideBordersTop# [Icon] Meter=IMAGE Group=FeedData ImageName=#@#Images\Gcal.#ColorImage#.png X=0 Y=6 W=73 H=73 [Title] Meter=STRING Group=FeedData X=11 Y=28 H=15 W=(#SidebarWidth#-0) ClipString=1 StringStyle=NORMAL FontColor=#Color1# FontSize=#Size3# FontFace=#Font# AntiAlias=1 ToolTipWidth=#SidebarWidth# DynamicVariables=1 Text=#FeedTitle# LeftMouseUpAction=["https://docs.google.com/spreadsheets/d/1234567890abcdefghijklmnopqrstuvwxyzebrasarecool"] ToolTipText=#FeedLink# ;----------------------- ; ITEMS [ItemWhat1] Meter=STRING Group=FeedData MeterStyle=StyleReaderText | StyleReaderTextSubheading | StyleReaderTextFirst Text=#Item1Title# ;----------------------- ; BORDER & GRABBERS [BorderBottom] Meter=IMAGE SolidColor=#ColorBorder4# X=10 Y=40r W=(#SidebarWidth#-26) H=1 Hidden=#HideBordersBottom# [Grabber1] Meter=IMAGE MeterStyle=StyleReaderGrabber | StyleReaderGrabber[MeasureActive1] | StyleReaderGrabberFirst LeftMouseUpAction=!CommandMeasure "MeasureScriptReader" "Show(1)" Group=FeedData | Tab2 Hidden=1 [Grabber2] Meter=IMAGE MeterStyle=StyleReaderGrabber | StyleReaderGrabber[MeasureActive2] LeftMouseUpAction=!CommandMeasure "MeasureScriptReader" "Show(2)" Group=FeedData | Tab2 Hidden=1 [Grabber3] Meter=IMAGE MeterStyle=StyleReaderGrabber | StyleReaderGrabber[MeasureActive3] LeftMouseUpAction=!CommandMeasure "MeasureScriptReader" "Show(3)" Group=FeedData | Tab3 Hidden=1 [Switcher] Measure=CALC Formula=((Switcher+1-#SkinMouseOver#) % (#SwitcherInterval#+2)) * #Reset# IfBelowValue=1 IfBelowAction=!SetVariable Reset 1 IfAboveValue=#SwitcherInterval# IfAboveAction=#SwitcherAction# DynamicVariables=1 Disabled=#SwitcherDisabled# ;--------------------------------------------------------------------- ; METADATA [Metadata] Name=Google Calendar Information=Shows upcoming events on your Google Calendars in rotating tabs. Based on Enigma GCal by Kaelri Version=5.0 License=Creative Commons BY-NC-SA 3.0
Code: Select all
; Modify:
[Icon]
Meter=IMAGE
Group=FeedData
ImageName=#@#Images\Gcal.#ColorImage#.png
X=0
Y=6
W=73
H=73
GreyScale=1
ImageTint=255,255,255
; Add:
[MeasureItemWhat1]
Measure=String
String=#Item1Title#
IfMatch=^0$
IfMatchAction=[!SetOption Icon ImageTint "255,255,255"][!UpdateMeter Icon][!Redraw]
IfNotMatchAction=[!SetOption Icon ImageTint "255,0,0"][!UpdateMeter Icon][!Redraw]
Or there is another, a little bit more complicated, but in my opinion, much more elegant solution as well. In such a simple case, when the tint color is either white or red (with the appropriate color codes, 255,255,255 and respectively 255,0,0), the ImageTint option might work dynamically as well. For instance you could replace the ImageTint=255,255,255 option of the [Icon] meter with the following one: ImageTint=255,(255-255*Clamp(#Item1Title#,0,1)),(255-255*Clamp(#Item1Title#,0,1)) (take care not to forget to add the required DynamicVariables=1 option as well). If you do this, the IfMatch must be removed from the [MeasureItemWhat1] measure, or even better, the whole [MeasureItemWhat1] should be removed (if it's not needed anywhere else).eclectic-tech wrote: ↑March 28th, 2020, 7:11 pm To change the icon color, you can add GreyScale=1 and ImageTint=255,255,255 to the the [Icon] image meter.
Then create a new String Measure [MeasureItemWhat1] to test the value of #Item1Title#.
If it is not 0, set the [Icon] option for ImageTint to RED (255,0,0), otherwise the ImageTint is set to WHITE (255,255,255).