How to use the pydeps.colors.rgb2css function in pydeps

To help you get started, we’ve selected a few pydeps examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github thebjorn / pydeps / tests / test_colors.py View on Github external
def test_rgb2css():
    assert rgb2css(red) == '#ff0000'
    assert rgb2css(green) == '#00ff00'
    assert rgb2css(yellow) == '#00ffff'
    assert rgb2css(blue) == '#0000ff'
    assert rgb2css(black) == '#000000'
    assert rgb2css(white) == '#ffffff'
github thebjorn / pydeps / tests / test_colors.py View on Github external
def test_rgb2css():
    assert rgb2css(red) == '#ff0000'
    assert rgb2css(green) == '#00ff00'
    assert rgb2css(yellow) == '#00ffff'
    assert rgb2css(blue) == '#0000ff'
    assert rgb2css(black) == '#000000'
    assert rgb2css(white) == '#ffffff'
github thebjorn / pydeps / tests / test_colors.py View on Github external
def test_rgb2css():
    assert rgb2css(red) == '#ff0000'
    assert rgb2css(green) == '#00ff00'
    assert rgb2css(yellow) == '#00ffff'
    assert rgb2css(blue) == '#0000ff'
    assert rgb2css(black) == '#000000'
    assert rgb2css(white) == '#ffffff'
github thebjorn / pydeps / tests / test_colors.py View on Github external
def test_rgb2css():
    assert rgb2css(red) == '#ff0000'
    assert rgb2css(green) == '#00ff00'
    assert rgb2css(yellow) == '#00ffff'
    assert rgb2css(blue) == '#0000ff'
    assert rgb2css(black) == '#000000'
    assert rgb2css(white) == '#ffffff'
github thebjorn / pydeps / tests / test_colors.py View on Github external
def test_rgb2css():
    assert rgb2css(red) == '#ff0000'
    assert rgb2css(green) == '#00ff00'
    assert rgb2css(yellow) == '#00ffff'
    assert rgb2css(blue) == '#0000ff'
    assert rgb2css(black) == '#000000'
    assert rgb2css(white) == '#ffffff'
github thebjorn / pydeps / tests / test_colors.py View on Github external
def test_rgb2css():
    assert rgb2css(red) == '#ff0000'
    assert rgb2css(green) == '#00ff00'
    assert rgb2css(yellow) == '#00ffff'
    assert rgb2css(blue) == '#0000ff'
    assert rgb2css(black) == '#000000'
    assert rgb2css(white) == '#ffffff'
github thebjorn / pydeps / pydeps / depgraph2dot.py View on Github external
visited.add(b)

            space = colors.ColorSpace(visited)
            for src in sorted(visited):
                bg, fg = depgraph.get_colors(src, space)
                kwargs = {}

                if src.name in depgraph.cyclenodes:
                    kwargs['shape'] = 'octagon'

                ctx.write_node(
                    src.name,
                    label=src.get_label(splitlength=14,
                                        rmprefix=self.kw.get('rmprefix')),
                    fillcolor=colors.rgb2css(bg),
                    fontcolor=colors.rgb2css(fg),
                    **kwargs
                )

        return ctx.text()