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


Python colors.lightgrey方法代码示例

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


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

示例1: __init__

# 需要导入模块: from reportlab.lib import colors [as 别名]
# 或者: from reportlab.lib.colors import lightgrey [as 别名]
def __init__(self,
            width="80%",
            thickness=1,
            lineCap='round',
            color=lightgrey,
            spaceBefore=1, spaceAfter=1,
            hAlign='CENTER', vAlign='BOTTOM',
            dash=None):
        Flowable.__init__(self)
        self.width = width
        self.lineWidth = thickness
        self.lineCap=lineCap
        self.spaceBefore = spaceBefore
        self.spaceAfter = spaceAfter
        self.color = color
        self.hAlign = hAlign
        self.vAlign = vAlign
        self.dash = dash 
开发者ID:Microvellum,项目名称:Fluid-Designer,代码行数:20,代码来源:flowables.py

示例2: add_code_example

# 需要导入模块: from reportlab.lib import colors [as 别名]
# 或者: from reportlab.lib.colors import lightgrey [as 别名]
def add_code_example(canvas, filename, plot_filename, x, y, width, height):
    canvas.setFillColor(lightgrey)
    canvas.rect(x, y, width, height, fill=1)
    canvas.drawImage(
        filename,
        x,
        20 * inch,
        width=width,
        height=height*0.2,
        mask=[10, 255, 10, 255, 10, 255]
    )
    canvas.drawImage(
        plot_filename,
        x + width * 0.025,
        y * 1.5,
        width=width * 0.95,
        height=height*0.5
    )

#################################
# Create document and its pieces
#################################
# Canvas (PDF) 
开发者ID:kikocorreoso,项目名称:scikit-extremes,代码行数:25,代码来源:poster_PyConES2019_ESversion.py

示例3: __init__

# 需要导入模块: from reportlab.lib import colors [as 别名]
# 或者: from reportlab.lib.colors import lightgrey [as 别名]
def __init__(self, data, horizontal_align=None, style=None):
        Table.__init__(self, data, hAlign=horizontal_align)

        default_style = [
            ('INNERGRID', (0, 0), (-1, -1), .25, colors.black),
            ('BOX', (0, 0), (-1, -1), .25, colors.black),
            ('BACKGROUND', (0, 0), (-1, -len(data)), colors.lightgrey),
            ('ALIGN', (0, 0), (-1, -1), 'CENTER'),
            ('VALIGN', (0, 0), (-1, -1), 'MIDDLE')
        ]

        if style and isinstance(style, list):
            default_style.extend(style)

        self.setStyle(TableStyle(default_style)) 
开发者ID:CiCiApp,项目名称:PyInvoice,代码行数:17,代码来源:components.py

示例4: add_fold_lines

# 需要导入模块: from reportlab.lib import colors [as 别名]
# 或者: from reportlab.lib.colors import lightgrey [as 别名]
def add_fold_lines(c):
    """Add lines to show where to fold card"""
    # choose some colors
    c.setFillColor(lightgrey)
    # line settings
    c.setLineWidth(1)
    c.setDash(1,5) #n points on, m off
    # draw some lines
    c.line(width/2,0,width/2,height) #vertical
    c.line(0,height/2,width,height/2) #horz. 
开发者ID:ActiveState,项目名称:code,代码行数:12,代码来源:recipe-535155.py

示例5: _posting_list_table

# 需要导入模块: from reportlab.lib import colors [as 别名]
# 或者: from reportlab.lib.colors import lightgrey [as 别名]
def _posting_list_table(self, canvas, x1, y1, x2, y2, shipping_labels):
        style = self.table_style[:]
        table = [self.table_header]
        for i, shipping_label in enumerate(shipping_labels, start=1):
            row = (
                str(shipping_label.tracking_code),
                str(shipping_label.receiver.zip_code),
                str(shipping_label.package.weight),
                self.yes if ExtraService.get(EXTRA_SERVICE_AR) in shipping_label else self.no,
                self.yes if ExtraService.get(EXTRA_SERVICE_MP) in shipping_label else self.no,
                self.yes if shipping_label.has_declared_value() else self.no,
                str(shipping_label.value).replace(".", ",") if shipping_label.value is not None else "",
                str(shipping_label.invoice_number),
                shipping_label.get_package_sequence(),
                shipping_label.receiver.name[: self.max_receiver_name_size],
            )

            # noinspection PyTypeChecker
            table.append(row)

            if i % 2:
                style.append(("BACKGROUND", (0, i), (-1, i), colors.lightgrey))

        table_flow = Table(table, colWidths=self.col_widths, style=TableStyle(style))
        w, h = table_flow.wrap(0, 0)
        table_flow.drawOn(canvas, x1, y2 - h - 50 * mm) 
开发者ID:olist,项目名称:correios,代码行数:28,代码来源:pdf.py

示例6: getDrawing13

# 需要导入模块: from reportlab.lib import colors [as 别名]
# 或者: from reportlab.lib.colors import lightgrey [as 别名]
def getDrawing13():
    'Test Various TTF Fonts'

    def drawit(F,w=400,h=200,fontSize=12,slack=2,gap=5):
        D = Drawing(w,h)
        th = 2*gap + fontSize*1.2
        gh = gap + .2*fontSize
        y = h
        maxx = 0
        for fontName in F:
            y -= th
            text = fontName+asNative(b': I should be totally horizontal and enclosed in a box and end in alphabetagamma \xc2\xa2\xc2\xa9\xc2\xae\xc2\xa3\xca\xa5\xd0\x96\xd6\x83\xd7\x90\xd9\x82\xe0\xa6\x95\xce\xb1\xce\xb2\xce\xb3')
            textWidth = stringWidth(text, fontName, fontSize)
            maxx = max(maxx,textWidth+20)
            D.add(
                Group(Rect(8, y-gh, textWidth + 4, th, strokeColor=colors.red, strokeWidth=.5, fillColor=colors.lightgrey),
                    String(10, y, text, fontName=fontName, fontSize = fontSize)))
            y -= 5
        return maxx, h-y+gap, D
    maxx, maxy, D = drawit(_FONTS)
    if maxx>400 or maxy>200: _,_,D = drawit(_FONTS,maxx,maxy)
    return D

##def getDrawing14():
##    """This tests inherited properties.  Each font should be as it says."""
##    D = Drawing(400, 200)
##    
##    fontSize = 12
##    D.fontName = 'Courier'
##    
##    g1 = Group(
##            Rect(0, 0, 150, 20, fillColor=colors.yellow),
##            String(5, 5, 'Inherited Courier', fontName=inherit, fontSize = fontSize)
##            )
##    D.add(g1)
##
##    g2 = Group(g1, transform = translate(25,25))
##    D.add(g2)
##
##    g3 = Group(g2, transform = translate(25,25))
##    D.add(g3)
##
##    g4 = Group(g3, transform = translate(25,25))
##    D.add(g4)
##
##
##    return D 
开发者ID:Microvellum,项目名称:Fluid-Designer,代码行数:49,代码来源:testshapes.py

示例7: getDrawing13

# 需要导入模块: from reportlab.lib import colors [as 别名]
# 或者: from reportlab.lib.colors import lightgrey [as 别名]
def getDrawing13():
    'Test Various TTF Fonts'

    def drawit(F,w=400,h=200,fontSize=12,slack=2,gap=5):
        D = Drawing(w,h)
        th = 2*gap + fontSize*1.2
        gh = gap + .2*fontSize
        y = h
        maxx = 0
        for fontName in F:
            y -= th
            text = fontName+": I should be totally horizontal and enclosed in a box and end in alphabetagamma \xc2\xa2\xc2\xa9\xc2\xae\xc2\xa3\xca\xa5\xd0\x96\xd6\x83\xd7\x90\xd9\x82\xe0\xa6\x95\xce\xb1\xce\xb2\xce\xb3"
            textWidth = stringWidth(text, fontName, fontSize)
            maxx = max(maxx,textWidth+20)
            D.add(
                Group(Rect(8, y-gh, textWidth + 4, th, strokeColor=colors.red, strokeWidth=.5, fillColor=colors.lightgrey),
                    String(10, y, text, fontName=fontName, fontSize = fontSize)))
            y -= 5
        return maxx, h-y+gap, D
    maxx, maxy, D = drawit(_FONTS)
    if maxx>400 or maxy>200: _,_,D = drawit(_FONTS,maxx,maxy)
    return D

##def getDrawing14():
##    """This tests inherited properties.  Each font should be as it says."""
##    D = Drawing(400, 200)
##    
##    fontSize = 12
##    D.fontName = 'Courier'
##    
##    g1 = Group(
##            Rect(0, 0, 150, 20, fillColor=colors.yellow),
##            String(5, 5, 'Inherited Courier', fontName=inherit, fontSize = fontSize)
##            )
##    D.add(g1)
##
##    g2 = Group(g1, transform = translate(25,25))
##    D.add(g2)
##
##    g3 = Group(g2, transform = translate(25,25))
##    D.add(g3)
##
##    g4 = Group(g3, transform = translate(25,25))
##    D.add(g4)
##
##
##    return D 
开发者ID:gltn,项目名称:stdm,代码行数:49,代码来源:testshapes.py


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