如何将Rebol中的按钮设置为红色?尝试代码后仍显灰色
Ah, I spot the problem with your code! Just appending the RGB value 100.0.0 after the button label doesn’t work because Rebol’s View dialect doesn’t automatically interpret that as a color parameter. You need to explicitly use the color keyword to tell the widget what you’re setting.
Here’s the corrected version of your code that will make the button red:
View [button "colored" color 100.0.0]
If you prefer more readable syntax, Rebol also supports predefined color words (like red) or hexadecimal color codes (like #ff0000), which work the same way:
# Using a predefined color word View [button "colored" color red] # Using a hexadecimal color code View [button "colored" color #ff0000]
Bonus tip: If you want to adjust the text color to contrast better with the red background, you can add the text-color keyword too:
View [button "colored" color red text-color white]
内容的提问来源于stack exchange,提问作者user310291
相关产品推荐
相关产品推荐

