本文整理汇总了Golang中github.com/iostrovok/svg/style.Style函数的典型用法代码示例。如果您正苦于以下问题:Golang Style函数的具体用法?Golang Style怎么用?Golang Style使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Style函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: Test_path_Style
func (s PATHTestsSuite) Test_path_Style(c *C) {
// c.Skip(`Not now")
p := Path(style.Style().StrokeRGB(10, 20, 30))
p = p.M(0, 0).L(100, 200)
st := style.Style().FillRGB(1, 2, 3)
p = p.Style(st).Append(Title("WWW"))
obtained := cSL(`<path d="M0,0 L100,200" style="fill:rgb(1,2,3)"><title>WWW</title></path>`)
c.Assert(cSL(p.Source()), Equals, obtained)
}
示例2: Test_polyline2
func (s POLYLINETestsSuite) Test_polyline2(c *C) {
//c.Skip("Not now")
l := Polyline(style.Style().StrokeRGB(10, 20, 30))
res := l.Source()
c.Assert(cSL(res), Equals, "")
}
示例3: Test_use2
func (s USETestsSuite) Test_use2(c *C) {
//c.Skip("Not now")
l := Use(style.Style().StrokeRGB(10, 20, 30))
res := l.Source()
c.Assert(cSL(res), Equals, ``)
}
示例4: Test_line
func (s LINETestsSuite) Test_line(c *C) {
//c.Skip("Not now")
l := Line(1, 2, 3, 4)
c.Assert(l, NotNil)
l2 := Line(1, 2, 3, 4, style.Style())
c.Assert(l2, NotNil)
}
示例5: Test_rect
func (s RECTTestsSuite) Test_rect(c *C) {
//c.Skip("Not now")
l := Rect(1, 2, 3, 4)
c.Assert(l, NotNil)
l2 := Rect(1, 2, 3, 4, style.Style())
c.Assert(l2, NotNil)
}
示例6: Test_use_href
func (s USETestsSuite) Test_use_href(c *C) {
//c.Skip("Not now")
obtained := cSL(`<use xlink:href="#MySymbol" style="stroke:rgb(10,20,30)"/>`)
l := Use(style.Style().StrokeRGB(10, 20, 30)).Href(`#MySymbol`)
res := l.Source()
c.Assert(cSL(res), Equals, obtained)
}
示例7: Test_group
func (s GROUPTestsSuite) Test_group(c *C) {
//c.Skip("Not now")
l := Group()
c.Assert(l, NotNil)
l2 := Group(style.Style())
c.Assert(l2, NotNil)
}
示例8: Test_path_Aa
func (s PATHTestsSuite) Test_path_Aa(c *C) {
//c.Skip(`Not now")
obtained := cSL(`<path d="M0,0 A10,20 30 1,1 40,50 a11,21 31 0,0 41,51" style="stroke:rgb(10,20,30)"/>`)
p := Path(style.Style().StrokeRGB(10, 20, 30))
p = p.M(0, 0).A(10, 20, 30, 1, 1, 40, 50).Aa(11, 21, 31, 0, 0, 41, 51)
c.Assert(cSL(p.Source()), Equals, obtained)
}
示例9: Test_polyline
func (s POLYLINETestsSuite) Test_polyline(c *C) {
//c.Skip("Not now")
l := Polyline()
c.Assert(l, NotNil)
l2 := Polyline(style.Style())
c.Assert(l2, NotNil)
}
示例10: Test_text
func (s TEXTTestsSuite) Test_text(c *C) {
//c.Skip("Not now")
t1 := Text()
c.Assert(t1, NotNil)
t2 := Text(style.Style())
c.Assert(t2, NotNil)
}
示例11: Test_polygon
func (s POLYGONTestsSuite) Test_polygon(c *C) {
//c.Skip("Not now")
l := Polygon()
c.Assert(l, NotNil)
l2 := Polygon(style.Style())
c.Assert(l2, NotNil)
}
示例12: Test_use
func (s USETestsSuite) Test_use(c *C) {
//c.Skip("Not now")
l := Use()
c.Assert(l, NotNil)
l2 := Use(style.Style())
c.Assert(l2, NotNil)
}
示例13: Test_rect2
func (s RECTTestsSuite) Test_rect2(c *C) {
//c.Skip("Not now")
obtained := cSL(`<rect height="4" width="3" x="1" y="2" style="stroke:rgb(10,20,30)"/>`)
l := Rect(1, 2, 3, 4, style.Style().StrokeRGB(10, 20, 30))
res := l.Source()
c.Assert(cSL(res), Equals, obtained)
}
示例14: Test_path_HhVv
func (s PATHTestsSuite) Test_path_HhVv(c *C) {
//c.Skip(`Not now")
obtained := cSL(`<path d="M0,0 V100 v200 H300 h400" style="stroke:rgb(10,20,30)"/>`)
p := Path(style.Style().StrokeRGB(10, 20, 30))
p = p.M(0, 0).V(100).Vv(200).H(300).Hh(400)
c.Assert(cSL(p.Source()), Equals, obtained)
}
示例15: Test_Style
func (s TAGTestsSuite) Test_Style(c *C) {
//c.Skip("Not now")
obtained := cSL(`<g style="fill:rgb(1,2,3)"/>`)
st := style.Style().FillRGB(1, 2, 3)
l := Tag("g").Style(st)
c.Assert(cSL(l.Source()), Equals, obtained)
}