当前位置: 首页>>代码示例>>Python>>正文


Python colors.white方法代码示例

本文整理汇总了Python中reportlab.lib.colors.white方法的典型用法代码示例。如果您正苦于以下问题:Python colors.white方法的具体用法?Python colors.white怎么用?Python colors.white使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在reportlab.lib.colors的用法示例。


在下文中一共展示了colors.white方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: demo

# 需要导入模块: from reportlab.lib import colors [as 别名]
# 或者: from reportlab.lib.colors import white [as 别名]
def demo(self):
        """Shows basic use of a line chart."""

        drawing = Drawing(200, 100)

        data = [
                (13, 5, 20, 22, 37, 45, 19, 4),
                (14, 10, 21, 28, 38, 46, 25, 5)
                ]

        lc = SampleHorizontalLineChart()

        lc.x = 20
        lc.y = 10
        lc.height = 85
        lc.width = 170
        lc.data = data
        lc.strokeColor = colors.white
        lc.fillColor = colors.HexColor(0xCCCCCC)

        drawing.add(lc)

        return drawing 
开发者ID:Microvellum,项目名称:Fluid-Designer,代码行数:25,代码来源:linecharts.py

示例2: test_filling

# 需要导入模块: from reportlab.lib import colors [as 别名]
# 或者: from reportlab.lib.colors import white [as 别名]
def test_filling(self):
        converter = svglib.Svg2RlgShapeConverter(None)
        node = svglib.NodeTracker(etree.XML(
            '<polyline fill="none" stroke="#000000" '
            'points="10,50,35,150,60,50,85,150,110,50,135,150" />'
        ))
        polyline = converter.convertPolyline(node)
        assert isinstance(polyline, PolyLine)

        # svglib simulates polyline filling by a fake polygon.
        node = svglib.NodeTracker(etree.XML(
            '<polyline fill="#fff" stroke="#000000" '
            'points="10,50,35,150,60,50,85,150,110,50,135,150" />'
        ))
        group = converter.convertPolyline(node)
        assert isinstance(group.contents[0], Polygon)
        assert group.contents[0].fillColor == colors.white
        assert isinstance(group.contents[1], PolyLine) 
开发者ID:deeplook,项目名称:svglib,代码行数:20,代码来源:test_basic.py

示例3: apply_color

# 需要导入模块: from reportlab.lib import colors [as 别名]
# 或者: from reportlab.lib.colors import white [as 别名]
def apply_color(formatter, cmap=None, font_bw=1, stripe_rows=1, stripe_cols=0,
                    hdr_border_clazz=BorderTypeGrid, cell_border_clazz=BorderTypeOutline, border_weight=.7):
        """
        font_bw: bool, If True use black and white fonts. If False, then use the cmap
        """
        cmap = cmap or Style.Blue
        light = cmap.get('Light', white)
        medium = cmap.get('Medium', gray)
        dark = cmap.get('Dark', black)
        # the ranges
        header = formatter.all.iloc[:formatter.header.nrows]
        cells = formatter.all.iloc[formatter.header.nrows:]
        # color the header
        hdr_border_clazz and header.set_border_type(hdr_border_clazz, color=medium, weight=border_weight)
        header.set_textcolor(font_bw and white or light)
        header.set_background(dark)
        # color the cells
        cell_border_clazz and cells.set_border_type(cell_border_clazz, color=medium, weight=border_weight)
        stripe_rows and cells.set_row_backgrounds([light, white])
        stripe_cols and cells.set_col_backgrounds([white, light])
        not font_bw and cells.set_textcolor(dark) 
开发者ID:bpsmith,项目名称:tia,代码行数:23,代码来源:table.py

示例4: table_model

# 需要导入模块: from reportlab.lib import colors [as 别名]
# 或者: from reportlab.lib.colors import white [as 别名]
def table_model():
    """
    添加表格
    :return:
    """
    template_path = current_app.config.get("REPORT_TEMPLATES")
    image_path = os.path.join(template_path, 'test.jpg')
    new_img = Image(image_path, width=300, height=300)
    base = [
        [new_img, ""],
        ["大类", "小类"],
        ["WebFramework", "django"],
        ["", "flask"],
        ["", "web.py"],
        ["", "tornado"],
        ["Office", "xlsxwriter"],
        ["", "openpyxl"],
        ["", "xlrd"],
        ["", "xlwt"],
        ["", "python-docx"],
        ["", "docxtpl"],
    ]

    style = [
        # 设置字体
        ('FONTNAME', (0, 0), (-1, -1), 'SimSun'),

        # 合并单元格 (列,行)
        ('SPAN', (0, 0), (1, 0)),
        ('SPAN', (0, 2), (0, 5)),
        ('SPAN', (0, 6), (0, 11)),

        # 单元格背景
        ('BACKGROUND', (0, 1), (1, 1), HexColor('#548DD4')),

        # 字体颜色
        ('TEXTCOLOR', (0, 1), (1, 1), colors.white),
        # 对齐设置
        ('VALIGN', (0, 0), (-1, -1), 'MIDDLE'),
        ('ALIGN', (0, 0), (-1, -1), 'CENTER'),

        # 单元格框线
        ('GRID', (0, 0), (-1, -1), 0.5, colors.grey),
        ('BOX', (0, 0), (-1, -1), 0.5, colors.black),

    ]

    component_table = Table(base, style=style)
    return component_table 
开发者ID:qzq1111,项目名称:flask-restful-example,代码行数:51,代码来源:report.py

示例5: sample1a

# 需要导入模块: from reportlab.lib import colors [as 别名]
# 或者: from reportlab.lib.colors import white [as 别名]
def sample1a():
    drawing = Drawing(400, 200)

    data = [
            (13, 5, 20, 22, 37, 45, 19, 4),
            (5, 20, 46, 38, 23, 21, 6, 14)
            ]

    lc = SampleHorizontalLineChart()

    lc.x = 50
    lc.y = 50
    lc.height = 125
    lc.width = 300
    lc.data = data
    lc.joinedLines = 1
    lc.strokeColor = colors.white
    lc.fillColor = colors.HexColor(0xCCCCCC)
    lc.lines.symbol = makeMarker('FilledDiamond')
    lc.lineLabelFormat = '%2.0f'

    catNames = 'Jan Feb Mar Apr May Jun Jul Aug'.split(' ')
    lc.categoryAxis.categoryNames = catNames
    lc.categoryAxis.labels.boxAnchor = 'n'

    lc.valueAxis.valueMin = 0
    lc.valueAxis.valueMax = 60
    lc.valueAxis.valueStep = 15

    drawing.add(lc)

    return drawing 
开发者ID:Microvellum,项目名称:Fluid-Designer,代码行数:34,代码来源:linecharts.py

示例6: makeEmptyCircle

# 需要导入模块: from reportlab.lib import colors [as 别名]
# 或者: from reportlab.lib.colors import white [as 别名]
def makeEmptyCircle(x, y, size, color):
    "Make a hollow circle marker."

    d = size/2.0
    circle = Circle(x, y, d)
    circle.strokeColor = color
    circle.fillColor = colors.white

    return circle 
开发者ID:Microvellum,项目名称:Fluid-Designer,代码行数:11,代码来源:markers.py

示例7: test

# 需要导入模块: from reportlab.lib import colors [as 别名]
# 或者: from reportlab.lib.colors import white [as 别名]
def test():
    from reportlab.graphics.charts.piecharts import WedgeProperties
    wedges = TypedPropertyCollection(WedgeProperties)
    wedges.fillColor = colors.red
    wedges.setVector(fillColor=(colors.blue,colors.green,colors.white))
    print(len(_ItemWrapper))

    d = shapes.Drawing(400, 200)
    tc = TwoCircles()
    d.add(tc)
    from reportlab.graphics import renderPDF
    renderPDF.drawToFile(d, 'sample_widget.pdf', 'A Sample Widget')
    print('saved sample_widget.pdf')

    d = shapes.Drawing(400, 200)
    f = Face()
    f.skinColor = colors.yellow
    f.mood = "sad"
    d.add(f, name='theFace')
    print('drawing 1 properties:')
    d.dumpProperties()
    renderPDF.drawToFile(d, 'face.pdf', 'A Sample Widget')
    print('saved face.pdf')

    d2 = d.expandUserNodes()
    renderPDF.drawToFile(d2, 'face_copy.pdf', 'An expanded drawing')
    print('saved face_copy.pdf')
    print('drawing 2 properties:')
    d2.dumpProperties() 
开发者ID:Microvellum,项目名称:Fluid-Designer,代码行数:31,代码来源:widgetbase.py

示例8: __init__

# 需要导入模块: from reportlab.lib import colors [as 别名]
# 或者: from reportlab.lib.colors import white [as 别名]
def __init__(self):
        self.x = 0
        self.y = 0
        self.size = 100
        self.fillColor = colors.white
        self.crossColor = colors.red
        self.strokeColor = colors.black
        self.crosswidth = 10 
开发者ID:Microvellum,项目名称:Fluid-Designer,代码行数:10,代码来源:signsandsymbols.py

示例9: __init__

# 需要导入模块: from reportlab.lib import colors [as 别名]
# 或者: from reportlab.lib.colors import white [as 别名]
def __init__(self,**kw):
        _Symbol.__init__(self)
        self.kind = None
        self.size = 100
        self.fillColor = colors.white
        self.border=1
        self.setProperties(kw) 
开发者ID:Microvellum,项目名称:Fluid-Designer,代码行数:9,代码来源:flags.py

示例10: __init__

# 需要导入模块: from reportlab.lib import colors [as 别名]
# 或者: from reportlab.lib.colors import white [as 别名]
def __init__(self):
        self.x = 0
        self.y = 0
        self.width = 100
        self.height = 100
        self.orientation = 'vertical'
        self.useLines = 0
        self.useRects = 1
        self.delta = 20
        self.delta0 = 0
        self.deltaSteps = []
        self.fillColor = colors.white
        self.stripeColors = [colors.red, colors.green, colors.blue]
        self.strokeColor = colors.black
        self.strokeWidth = 2 
开发者ID:Microvellum,项目名称:Fluid-Designer,代码行数:17,代码来源:grids.py

示例11: setFillGray

# 需要导入模块: from reportlab.lib import colors [as 别名]
# 或者: from reportlab.lib.colors import white [as 别名]
def setFillGray(self, gray, alpha=None):
        """Sets the gray level; 0.0=black, 1.0=white"""
        self._fillColorObj = (gray, gray, gray)
        self._code.append('%s g' % fp_str(gray))
        if alpha is not None:
            self.setFillAlpha(alpha) 
开发者ID:Microvellum,项目名称:Fluid-Designer,代码行数:8,代码来源:textobject.py

示例12: setStrokeGray

# 需要导入模块: from reportlab.lib import colors [as 别名]
# 或者: from reportlab.lib.colors import white [as 别名]
def setStrokeGray(self, gray, alpha=None):
        """Sets the gray level; 0.0=black, 1.0=white"""
        self._strokeColorObj = (gray, gray, gray)
        self._code.append('%s G' % fp_str(gray))
        if alpha is not None:
            self.setFillAlpha(alpha) 
开发者ID:Microvellum,项目名称:Fluid-Designer,代码行数:8,代码来源:textobject.py

示例13: __init__

# 需要导入模块: from reportlab.lib import colors [as 别名]
# 或者: from reportlab.lib.colors import white [as 别名]
def __init__(self):
        self.fillColor = white
        self.strokeColor = None
        self.strokeWidth = 0.1
        self.background = ReportLabBlue
        self.border = None
        self.borderWidth = 1
        self.shadow = 0.5
        self.height = 86
        self.width = 130
        self.x = self.y = self.angle = self.skewY = self._dx = 0
        self.skewX = 10
        self._dy = 35.5
        self.showPage = 1 
开发者ID:Microvellum,项目名称:Fluid-Designer,代码行数:16,代码来源:corp.py

示例14: test

# 需要导入模块: from reportlab.lib import colors [as 别名]
# 或者: from reportlab.lib.colors import white [as 别名]
def test():
    """This function produces a pdf with examples. """

    #white on blue
    rl = RL_CorpLogo()
    rl.width = 129
    rl.height = 86
    D = Drawing(rl.width,rl.height)
    D.add(rl)
    D.__dict__['verbose'] = 1
    D.save(fnRoot='corplogo_whiteonblue',formats=['pdf','eps','jpg','gif'])


    #blue on white
    rl = RL_CorpLogoReversed()
    rl.width = 129
    rl.height = 86
    D = Drawing(rl.width,rl.height)
    D.add(rl)
    D.__dict__['verbose'] = 1
    D.save(fnRoot='corplogo_blueonwhite',formats=['pdf','eps','jpg','gif'])

    #gray on white
    rl = RL_CorpLogoReversed()
    rl.fillColor = Color(0.2, 0.2, 0.2)
    rl.width = 129
    rl.height = 86
    D = Drawing(rl.width,rl.height)
    D.add(rl)
    D.__dict__['verbose'] = 1
    D.save(fnRoot='corplogo_grayonwhite',formats=['pdf','eps','jpg','gif'])


    rl = RL_BusinessCard()
    rl.x=25
    rl.y=25
    rl.border=1
    D = Drawing(rl.width+50,rl.height+50)
    D.add(rl)
    D.__dict__['verbose'] = 1
    D.save(fnRoot='RL_BusinessCard',formats=['pdf']) 
开发者ID:Microvellum,项目名称:Fluid-Designer,代码行数:43,代码来源:corp.py

示例15: create_hdr

# 需要导入模块: from reportlab.lib import colors [as 别名]
# 或者: from reportlab.lib.colors import white [as 别名]
def create_hdr(self, name, font_size):
        hdr_style = TableStyle([('TEXTCOLOR', (0, 0), (-1, -1), colors.black),
                                ('BOTTOMPADDING', (0, 0), (-1, -1), 15),
                                ('TOPPADDING', (0, 0), (-1, -1), 15),
                                ('FONTSIZE', (0, 0), (-1, -1), 8),
                                ('VALIGN', (0, 0), (-1, -1), 'TOP'),
                                ('ALIGN', (0, 0), (-1, 0), 'LEFT'),
                                ('LINEBELOW', (0, 0), (-1, -1), 2, colors.black),
                                ('BACKGROUND', (0, 1), (-1, -1), colors.white)])        
        
        name_p = Paragraph(name, ParagraphStyle("Category name style", fontSize=font_size))
        hdr_tbl = Table([[name_p]], colWidths = 500, rowHeights = None, repeatRows = 1)
        hdr_tbl.setStyle(hdr_style)
        self.elements.append(hdr_tbl) 
开发者ID:Microvellum,项目名称:Fluid-Designer,代码行数:16,代码来源:fd_api_doc.py


注:本文中的reportlab.lib.colors.white方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。