在 Stani Python 编辑器中更改空白颜色
我弄清楚了如何编辑 SPE 颜色的外观。一切正常,除非我尝试更改空白颜色:空白仍然是白色。下面是显示空白背景的值输入的代码片段。如何更改空白颜色?
# Global default styles for all languages
self.StyleSetSpec(wx_stc.STC_STYLE_DEFAULT, "face:%(mono)s,size:%(size)d" % self.faces)
self.StyleSetSpec(wx_stc.STC_STYLE_LINENUMBER, "back:#C0C0C0,face:%(mono)s,size:%(size)d" % self.faces)
self.StyleSetSpec(wx_stc.STC_STYLE_CONTROLCHAR, "face:%(mono)s" % self.faces)
self.StyleSetSpec(wx_stc.STC_STYLE_BRACELIGHT, "fore:#FFFFFF,back:#0000FF,bold")
self.StyleSetSpec(wx_stc.STC_STYLE_BRACEBAD, "fore:#000000,back:#FF0000,bold")
# Python styles
# White space
self.StyleSetSpec(wx_stc.STC_P_DEFAULT, "face:%(mono)s, back:#3366CC, size:%(size)d" % self.faces)
# Comment
self.StyleSetSpec(wx_stc.STC_P_COMMENTLINE, "face:%(mono)s,fore:#330099,back:#C0C0C0,italic,size:%(size)d" % self.faces)
# Number
self.StyleSetSpec(wx_stc.STC_P_NUMBER, "face:%(mono)s,fore:#00CC00,size:%(size)d" % self.faces)
# String
self.StyleSetSpec(wx_stc.STC_P_STRING, "face:%(mono)s,fore:#3399FF,size:%(size)d" % self.faces)
# Single quoted string
self.StyleSetSpec(wx_stc.STC_P_CHARACTER, "face:%(mono)s,fore:#7F007F,size:%(size)d" % self.faces)
# Keyword
self.StyleSetSpec(wx_stc.STC_P_WORD, "face:%(mono)s,fore:#339900,bold,size:%(size)d" % self.faces)
# Triple quotes
self.StyleSetSpec(wx_stc.STC_P_TRIPLE, "face:%(mono)s,fore:#FF3300,size:%(size)d" % self.faces)
# Triple double quotes
self.StyleSetSpec(wx_stc.STC_P_TRIPLEDOUBLE, "face:%(mono)s,fore:#7F0000,size:%(size)d" % self.faces)
# Class name definition
self.StyleSetSpec(wx_stc.STC_P_CLASSNAME, "face:%(mono)s,fore:#0000FF,bold,underline,size:%(size)d" % self.faces)
# Function or method name definition
self.StyleSetSpec(wx_stc.STC_P_DEFNAME, "face:%(mono)s,fore:#0066CC,bold,size:%(size)d" % self.faces)
# Operators
self.StyleSetSpec(wx_stc.STC_P_OPERATOR, "face:%(mono)s,bold,size:%(size)d" % self.faces)
# Identifiers
self.StyleSetSpec(wx_stc.STC_P_IDENTIFIER, "")
# Comment-blocks
self.StyleSetSpec(wx_stc.STC_P_COMMENTBLOCK, "face:%(mono)s,fore:#003300,back:#C0C0C0,italic,size:%(size)d" % self.faces)
# End of line where string is not closed
self.StyleSetSpec(wx_stc.STC_P_STRINGEOL, "face:%(mono)s,fore:#000000,face:%(mono)s,back:#E0C0E0,eol,size:%(size)d" % self.faces)
I figured out how to edit the looks of SPE colors. Everything works except when I try change the whitespace color: whitespace remains white. Below is a code snippet showing value input for the whitespace background. How can I change the whitespace color?
# Global default styles for all languages
self.StyleSetSpec(wx_stc.STC_STYLE_DEFAULT, "face:%(mono)s,size:%(size)d" % self.faces)
self.StyleSetSpec(wx_stc.STC_STYLE_LINENUMBER, "back:#C0C0C0,face:%(mono)s,size:%(size)d" % self.faces)
self.StyleSetSpec(wx_stc.STC_STYLE_CONTROLCHAR, "face:%(mono)s" % self.faces)
self.StyleSetSpec(wx_stc.STC_STYLE_BRACELIGHT, "fore:#FFFFFF,back:#0000FF,bold")
self.StyleSetSpec(wx_stc.STC_STYLE_BRACEBAD, "fore:#000000,back:#FF0000,bold")
# Python styles
# White space
self.StyleSetSpec(wx_stc.STC_P_DEFAULT, "face:%(mono)s, back:#3366CC, size:%(size)d" % self.faces)
# Comment
self.StyleSetSpec(wx_stc.STC_P_COMMENTLINE, "face:%(mono)s,fore:#330099,back:#C0C0C0,italic,size:%(size)d" % self.faces)
# Number
self.StyleSetSpec(wx_stc.STC_P_NUMBER, "face:%(mono)s,fore:#00CC00,size:%(size)d" % self.faces)
# String
self.StyleSetSpec(wx_stc.STC_P_STRING, "face:%(mono)s,fore:#3399FF,size:%(size)d" % self.faces)
# Single quoted string
self.StyleSetSpec(wx_stc.STC_P_CHARACTER, "face:%(mono)s,fore:#7F007F,size:%(size)d" % self.faces)
# Keyword
self.StyleSetSpec(wx_stc.STC_P_WORD, "face:%(mono)s,fore:#339900,bold,size:%(size)d" % self.faces)
# Triple quotes
self.StyleSetSpec(wx_stc.STC_P_TRIPLE, "face:%(mono)s,fore:#FF3300,size:%(size)d" % self.faces)
# Triple double quotes
self.StyleSetSpec(wx_stc.STC_P_TRIPLEDOUBLE, "face:%(mono)s,fore:#7F0000,size:%(size)d" % self.faces)
# Class name definition
self.StyleSetSpec(wx_stc.STC_P_CLASSNAME, "face:%(mono)s,fore:#0000FF,bold,underline,size:%(size)d" % self.faces)
# Function or method name definition
self.StyleSetSpec(wx_stc.STC_P_DEFNAME, "face:%(mono)s,fore:#0066CC,bold,size:%(size)d" % self.faces)
# Operators
self.StyleSetSpec(wx_stc.STC_P_OPERATOR, "face:%(mono)s,bold,size:%(size)d" % self.faces)
# Identifiers
self.StyleSetSpec(wx_stc.STC_P_IDENTIFIER, "")
# Comment-blocks
self.StyleSetSpec(wx_stc.STC_P_COMMENTBLOCK, "face:%(mono)s,fore:#003300,back:#C0C0C0,italic,size:%(size)d" % self.faces)
# End of line where string is not closed
self.StyleSetSpec(wx_stc.STC_P_STRINGEOL, "face:%(mono)s,fore:#000000,face:%(mono)s,back:#E0C0E0,eol,size:%(size)d" % self.faces)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
评论:如果将数据和代码分开,可能会更容易阅读配置:
Comment: It might be easier to read the configuration if you separate the data and the code: