{curl 3.0 applet} {curl-file-attributes character-encoding = "shift-jis"} {title Text Effect} || 2色の色を使ってテキストをフラッシュさせる {define-text-proc {FlashColor ...}:any let color-str:String = "green" let flash:TextFlowBox = {TextFlowBox font-weight = "bold", color = color-str, {value ...} } {flash.animate interval = 0.5s, {on TimerEvent do {if color-str == "red" then set color-str = "blue" else set color-str = "red" } set flash.color = color-str } } {return {paragraph {value flash}}} } || テキストの色を変化させる {define-text-proc {ChangeColor ...}:any {let r:Fraction, g:Fraction, b:Fraction} let color-str:String = "green" let change:TextFlowBox = {TextFlowBox font-weight = "bold", color = color-str, {value ...} } {change.animate interval = 0.1s, {on TimerEvent do set r = (r + 0.05) mod 1.0 set g = (g + 0.02) mod 1.0 set b = (b + 0.03) mod 1.0 set change.color = {Color.from-rgb r, g, b} } } {return {paragraph {value change}}} } || ここから描画 {FlashColor ようこそ Shinta のページへ} {ChangeColor ようこそ Shinta のページへ}