mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
parser: c2v fixes
This commit is contained in:
@@ -105,3 +105,14 @@ pub fn (c Color) eq(c2 Color) bool {
|
||||
pub fn (c Color) str() string {
|
||||
return 'Color{$c.r, $c.g, $c.b, $c.a}'
|
||||
}
|
||||
|
||||
const (
|
||||
string_colors = {
|
||||
'black': black
|
||||
'red': red
|
||||
}
|
||||
)
|
||||
|
||||
pub fn color_from_string(s string) Color {
|
||||
return string_colors[s]
|
||||
}
|
||||
|
Reference in New Issue
Block a user