當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。