Skip to content

Commit

Permalink
Reduce various thresholds in *Munsell Renotation* computations.
Browse files Browse the repository at this point in the history
  • Loading branch information
KelSolaar committed May 10, 2024
1 parent 22f2fcf commit 4b0c38d
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions colour/notation/munsell.py
Original file line number Diff line number Diff line change
Expand Up @@ -1073,7 +1073,7 @@ def _xyY_to_munsell_specification(xyY: ArrayLike) -> NDArrayFloat:
)
phi_input = np.degrees(phi_input)

grey_threshold = 1e-7
grey_threshold = THRESHOLD_INTEGER
if rho_input < grey_threshold:
return from_range_10(normalise_munsell_specification(value))

Expand All @@ -1098,7 +1098,7 @@ def _xyY_to_munsell_specification(xyY: ArrayLike) -> NDArrayFloat:
code_initial,
]

convergence_threshold = 1e-7
convergence_threshold = THRESHOLD_INTEGER / 1e4
iterations_maximum = 64
iterations = 0

Expand Down Expand Up @@ -2331,13 +2331,12 @@ def xy_from_renotation_ovoid(specification: ArrayLike) -> NDArrayFloat:

# Checking if renotation data is available without interpolation using
# given threshold.
threshold = 1e-7
if (
abs(hue) < threshold
or abs(hue - 2.5) < threshold
or abs(hue - 5) < threshold
or abs(hue - 7.5) < threshold
or abs(hue - 10) < threshold
abs(hue) < THRESHOLD_INTEGER
or abs(hue - 2.5) < THRESHOLD_INTEGER
or abs(hue - 5) < THRESHOLD_INTEGER
or abs(hue - 7.5) < THRESHOLD_INTEGER
or abs(hue - 10) < THRESHOLD_INTEGER
):
hue = 2.5 * round(hue / 2.5)

Expand Down

0 comments on commit 4b0c38d

Please sign in to comment.