Roughly. - This assumes that red and white are both Materials already in your project. - Almost every AI tool can now write xpression scripts for you that are basic like this. So use your tool of choice and then can get you what you need.
Dim matRed, matWhite
Dim timeArray, minutes, seconds, totalSeconds
' Retrieve the existing materials from the project
Engine.GetMaterialByName("RED", matRed)
Engine.GetMaterialByName("WHITE", matWhite)
' Split the text string into an array using the colon as the divider
timeArray = Split(Self.Text, ":")
' Check if the split created exactly two parts (minutes and seconds)
If UBound(timeArray) = 1 Then
' Ensure both parts are numbers to prevent script errors
If IsNumeric(timeArray(0)) And IsNumeric(timeArray(1)) Then
' Convert strings to integers
minutes = CInt(timeArray(0))
seconds = CInt(timeArray(1))
' Calculate the total time in seconds
totalSeconds = (minutes * 60) + seconds
' 1 minute and 30 seconds = 90 total seconds
If totalSeconds >= 90 Then
Self.SetMaterial 0, matRed
Else
Self.SetMaterial 0, matWhite
End If
Else
' Fallback to white if the text contains non-numeric characters
Self.SetMaterial 0, matWhite
End If
Else
' Fallback to white if the text doesn't contain exactly one colon
Self.SetMaterial 0, matWhite
End If
------------------------------
Garrett Hall
Overtime Elite
Atlanta United States
------------------------------