这是阻塞的示例
@value
struct ANSIColor(Color, Stringable):
"""ANSIColor is a color (0-15) as defined by the ANSI Standard."""
var value: Int
fn sequence(self, is_background: Bool) -> String:
var modifier: Int = 0
if is_background:
modifier += 10
if self.value < 8:
return str(modifier + self.value + 30)
else:
return str(modifier + self.value - 8 + 90)
我需要用它作为 Int 执行一些操作,然后返回一个 String