GithubHelp home page GithubHelp logo

secretbiology / secretcolors Goto Github PK

View Code? Open in Web Editor NEW
33.0 4.0 4.0 380 KB

Python package for fantastic colors :)

License: MIT License

Python 100.00%
python library color-palette ibm google-material colorbrewer vmware-vsphere

secretcolors's People

Contributors

ri0t avatar rohitsuratekar avatar rsuratekarnfer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

secretcolors's Issues

Issue while accessing get_colors in ColorMaps

Issue while accessing get_colors in ColorMaps

/opt/anaconda3/envs/analysis/lib/python3.9/site-packages/SecretColors/cmaps/parent.py in get_colors(self, name, no_of_colors)
    244                 self.log.error(f"Currently following number of colors are "
    245                                f"allowed for {name}. : {n}")
--> 246             return self.data[name][no_of_colors]
    247         return []
    248 

Picking random colors can result in an IndexError

What i am trying to do

I am trying to pick a random color via SecretColors.Palette(palette_name, show_warning=False).random()

What i expect to happen

A random color should be returned, most of the time, it does correctly do that.

What happens instead

Apparently - very rarely - this happens:

  File "/home/riot/src/isomer/isomer_master/isomer/misc/__init__.py", line 906, in std_color
    color = SecretColors.Palette(palette_name, show_warning=False).random()
  File "/home/riot/.virtualenvs/isomer/lib/python3.7/site-packages/SecretColors/palette.py", line 368, in random
    force_gray=force_gray), alpha=alpha,
  File "/home/riot/.virtualenvs/isomer/lib/python3.7/site-packages/SecretColors/palette.py", line 297, in __random
    ending_shade=end_shade)
  File "/home/riot/.virtualenvs/isomer/lib/python3.7/site-packages/SecretColors/palette.py", line 274, in __random_pick
    no_of_colors)
  File "/home/riot/.virtualenvs/isomer/lib/python3.7/site-packages/SecretColors/__color.py", line 206, in random_between
    return [self.shade(x) for x in random_shades]
  File "/home/riot/.virtualenvs/isomer/lib/python3.7/site-packages/SecretColors/__color.py", line 206, in <listcomp>
    return [self.shade(x) for x in random_shades]
  File "/home/riot/.virtualenvs/isomer/lib/python3.7/site-packages/SecretColors/__color.py", line 186, in shade
    return col2[ind2]
IndexError: list index out of range

Steps to Reproduce

import SecretColors as sc

for x in range(10000):
    _ = sc.Palette().random()

numpy dependency is a bit too new, maybe

I'm having trouble installing SecretColors as dependency on Debian stable (buster) systems, as these only have python3-numpy 1.16.

Luckily (i tested) SecretColors doesn't even need that new of a numpy, so i propose downgrading it to >=1.16.2

Edit: Also, currently newer versions than 1.19.1 are rejected, which would be the case on any newer-than-stable Debian

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.