fixes #28
This commit is contained in:
parent
ad0a3ffda9
commit
8dbc1da708
2 changed files with 9 additions and 0 deletions
|
|
@ -14,6 +14,7 @@ proc `&`*(a, b: cstring): cstring {.importcpp: "(# + #)", nodecl.}
|
||||||
proc toCstr*(s: int): cstring {.importcpp: "((#)+'')", nodecl.}
|
proc toCstr*(s: int): cstring {.importcpp: "((#)+'')", nodecl.}
|
||||||
proc `&`*(s: int): cstring {.importcpp: "((#)+'')", nodecl.}
|
proc `&`*(s: int): cstring {.importcpp: "((#)+'')", nodecl.}
|
||||||
proc `&`*(s: bool): cstring {.importcpp: "((#)+'')", nodecl.}
|
proc `&`*(s: bool): cstring {.importcpp: "((#)+'')", nodecl.}
|
||||||
|
proc `&`*(s: float): cstring {.importcpp: "((#)+'')", nodecl.}
|
||||||
|
|
||||||
proc `&`*(s: cstring): cstring {.importcpp: "(#)", nodecl.}
|
proc `&`*(s: cstring): cstring {.importcpp: "(#)", nodecl.}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -255,3 +255,11 @@ proc applyStyle*(n: Node; s: VStyle) =
|
||||||
n.style = Style()
|
n.style = Style()
|
||||||
for x in s.mask:
|
for x in s.mask:
|
||||||
n.style.setStyle(toStyleAttrName[x], s.attrs[x])
|
n.style.setStyle(toStyleAttrName[x], s.attrs[x])
|
||||||
|
|
||||||
|
import jstrutils
|
||||||
|
|
||||||
|
proc rgb*(r, g, b: range[0..255]): cstring =
|
||||||
|
cstring"rgb(" & &r & cstring", " & &g & cstring", " & &b & cstring")"
|
||||||
|
|
||||||
|
proc rgba*(r, g, b: range[0..255], alpha: float): cstring =
|
||||||
|
cstring"rgb(" & &r & cstring", " & &g & cstring", " & &b & cstring", " & &alpha & cstring")"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue