Skip to content

Commit

Permalink
Merge pull request #30 from coderesting/pastel_factor_typing_hint
Browse files Browse the repository at this point in the history
Hint for python typing that pastel_factor is a float
  • Loading branch information
jack89roberts committed Sep 18, 2023
2 parents 9f9f15e + 00e6161 commit 0ed9c7c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/pythonapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ jobs:
- name: Code quality checks
run: |
isort --check-only .
black --check .
isort --check-only --diff .
black --check --diff .
flake8
build_and_test:
Expand Down
2 changes: 1 addition & 1 deletion distinctipy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

name = "distinctipy"

__version__ = "1.2.2"
__version__ = "1.2.3"

# Expose these module names and their internals in the top-level API
__external__ = ["distinctipy"]
Expand Down
1 change: 0 additions & 1 deletion distinctipy/colorblind.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ def rgb2xyz(rgb):


def xyz2rgb(xyz):

x = xyz[0]
y = xyz[1]
z = xyz[2]
Expand Down
6 changes: 3 additions & 3 deletions distinctipy/distinctipy.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def _ensure_rng(rng):
return rng


def get_random_color(pastel_factor=0, rng=None):
def get_random_color(pastel_factor=0.0, rng=None):
"""
Generate a random rgb colour.
Expand Down Expand Up @@ -126,7 +126,7 @@ def color_distance(c1, c2):


def distinct_color(
exclude_colors, pastel_factor=0, n_attempts=1000, colorblind_type=None, rng=None
exclude_colors, pastel_factor=0.0, n_attempts=1000, colorblind_type=None, rng=None
):
"""
Generate a colour as distinct as possible from the colours defined in exclude_colors
Expand Down Expand Up @@ -239,7 +239,7 @@ def get_colors(
n_colors,
exclude_colors=None,
return_excluded=False,
pastel_factor=0,
pastel_factor=0.0,
n_attempts=1000,
colorblind_type=None,
rng=None,
Expand Down

0 comments on commit 0ed9c7c

Please sign in to comment.