diff --git a/coloraide/algebra.py b/coloraide/algebra.py index 41fc6425..ebc0f439 100644 --- a/coloraide/algebra.py +++ b/coloraide/algebra.py @@ -146,7 +146,7 @@ def clamp( mn: SupportsFloatOrInt | None = None, mx: SupportsFloatOrInt | None = None ) -> SupportsFloatOrInt: - """Clamp the value to the the given minimum and maximum.""" + """Clamp the value to the given minimum and maximum.""" if mn is not None and mx is not None: return max(min(value, mx), mn) @@ -1547,7 +1547,7 @@ def __next__(self) -> tuple[float, ...]: def __iter__(self) -> Iterator[tuple[float, ...]]: # pragma: no cover """Iterate.""" - # Setup and and return the iterator. + # Setup and return the iterator. return self @@ -1631,7 +1631,7 @@ def __next__(self) -> tuple[float, ...]: def __iter__(self) -> Broadcast: """Iterate.""" - # Setup and and return the iterator. + # Setup and return the iterator. return self @@ -2790,7 +2790,7 @@ def solve(a: MatrixLike | TensorLike, b: ArrayLike) -> Array: of dependent variables. 2. If we have [..., M, M] and [..., M, M] and it we have multiple sets of linear - equations it will be treated as as multiple [M, M] and [M] cases as described in 1). + equations it will be treated as multiple [M, M] and [M] cases as described in 1). If we have only one set of linear equations, it will be treated as a [..., M, M] and [..., M, K] case as described in 3). diff --git a/coloraide/color.py b/coloraide/color.py index e48d66b6..b9e18dbb 100644 --- a/coloraide/color.py +++ b/coloraide/color.py @@ -473,7 +473,7 @@ def random(cls, space: str, *, limits: Sequence[Sequence[float] | None] | None = if limits is None: limits = [] - # Acquire the minimum and maximum for the channel and get a random value value between + # Acquire the minimum and maximum for the channel and get a random value between length = len(limits) coords = [] for i in range(num_chan): @@ -764,7 +764,7 @@ def split_chromaticity( if cspace == 'xyz': raise ValueError('XYZ is not a luminant-chromaticity color space.') - # Convert to the the requested uv color space if required. + # Convert to the requested uv color space if required. return ( self.convert_chromaticity('xyz', cspace, coords, white=white) if cspace != 'xy_1931' else coords ) diff --git a/coloraide/spaces/cam16_jmh.py b/coloraide/spaces/cam16_jmh.py index c1f2879a..cfa47f5a 100644 --- a/coloraide/spaces/cam16_jmh.py +++ b/coloraide/spaces/cam16_jmh.py @@ -108,7 +108,7 @@ class Environment: white: This is the (x, y) chromaticity points for the white point. This should be the same value as set in the color class `WHITE` value. - adapting_luminance: This is the the luminance of the adapting field. The units are in cd/m2. + adapting_luminance: This is the luminance of the adapting field. The units are in cd/m2. The equation is `L = (E * R) / π`, where `E` is the illuminance in lux, `R` is the reflectance, and `L` is the luminance. If we assume a perfectly reflecting diffuser, `R` is assumed as 1. For the "gray world" assumption, we must also divide by 5 (or multiply by 0.2 - 20%). diff --git a/coloraide/spaces/zcam_jmh.py b/coloraide/spaces/zcam_jmh.py index d8990cb7..0d7310ae 100644 --- a/coloraide/spaces/zcam_jmh.py +++ b/coloraide/spaces/zcam_jmh.py @@ -137,7 +137,7 @@ class Environment: ref_white: The reference white in XYZ scaled by 100. - adapting_luminance: This is the the luminance of the adapting field. The units are in cd/m2. + adapting_luminance: This is the luminance of the adapting field. The units are in cd/m2. The equation is `L = (E * R) / π`, where `E` is the illuminance in lux, `R` is the reflectance, and `L` is the luminance. If we assume a perfectly reflecting diffuser, `R` is assumed as 1. For the "gray world" assumption, we must also divide by 5 (or multiply by 0.2 - 20%). diff --git a/docs/src/markdown/about/acknowledgments.md b/docs/src/markdown/about/acknowledgments.md index 298ecab8..1a749e58 100644 --- a/docs/src/markdown/about/acknowledgments.md +++ b/docs/src/markdown/about/acknowledgments.md @@ -1,6 +1,6 @@ # Acknowledgments -All projects gain help and inspiration from somewhere, and we wanted to document the places in which we we gathered +All projects gain help and inspiration from somewhere, and we wanted to document the places in which we gathered knowledge, ideas, and help. ## Projects diff --git a/docs/src/markdown/about/changelog.md b/docs/src/markdown/about/changelog.md index a96cc571..2dcf3667 100644 --- a/docs/src/markdown/about/changelog.md +++ b/docs/src/markdown/about/changelog.md @@ -176,7 +176,7 @@ conversion if the algorithm requires it. - **NEW**: Channels can be accessed by `get` and `set` using their numerical value (as a string input). - **NEW**: Color space plugins that specify the gamut space via `GAMUT_CHECK` must use that color space as a - reference when when gamut mapping or clipping by default. + reference when gamut mapping or clipping by default. - **NEW**: New color space plugin attribute `CLIP_SPACE` added which will override the space specified by `GAMUT_CHECK` to force clipping in the origin space even if a gamut mapping space is defined. This is only used when it is advantageous to clip in the origin space, e.g. when faster and still practical. @@ -536,7 +536,7 @@ imperceptible amount of transparency. If alpha is very close (`#!py3 1e-6`) to being opaque, just round it to opaque. - **FIX**: An easing function's output should not be clamped, only the input, and that only **needs** to occur on the - the outer range of an entire interpolation. + outer range of an entire interpolation. ## 1.0 @@ -625,7 +625,7 @@ a new Bezier interpolation method and added many more color spaces! - `interpolate` and `steps` functions are now `@classmethod`s. This alleviates the awkward handling of interpolating colors greater than 2. Before, the first color always had to be an instance and then the rest had - to be fed into that instance, now the the methods can be called from the base class or an instance with all the + to be fed into that instance, now the methods can be called from the base class or an instance with all the colors fed in via a list. Only the colors in the list will be evaluated during interpolation. - `Piecewise` object has been removed. - `stop` objects are used to wrap colors to apply a new color stop. diff --git a/docs/src/markdown/advanced.md b/docs/src/markdown/advanced.md index 19395eb9..72da7031 100644 --- a/docs/src/markdown/advanced.md +++ b/docs/src/markdown/advanced.md @@ -83,10 +83,10 @@ In general, ColorAide is careful to provide good round trip conversions where pr try to maintain a high level of accuracy so that when a color is converted to a different color and back that it will be very close, if not exactly, the same. -In general, we are able to keep decent round tripping by not not clipping values during conversion and maintaining as -high a level of precision as we can, but there are some cases where the high level of round trip accuracy cannot be -maintained, or even at all. There are even reasons where we willfully choose to sacrifice some accuracy for convenience -in order to uphold intuitive expectations for the user. +In general, we are able to keep decent round tripping by not clipping values during conversion and maintaining as high a +level of precision as we can, but there are some cases where the high level of round trip accuracy cannot be maintained, +or even at all. There are even reasons where we willfully choose to sacrifice some accuracy for convenience in order to +uphold intuitive expectations for the user. If you are a color scientist or you work in certain industries, there are definite reasons to uphold accuracy at all costs, but sometimes, you just want the colors to do the what you expect them to do. ColorAide tries to live in the @@ -138,7 +138,7 @@ is with cylindrical color models. ColorAide aims to make colors easy to use, but the one case that can frustrate users is interpolating with an achromatic color using a cylindrical color space. -Achromatic colors do not have a hue, but all conversions end up yielding something for hue, even it it has no practical +Achromatic colors do not have a hue, but all conversions end up yielding something for hue, even it has no practical meaning. This can cause odd color shifts when interpolating with an achromatic color. In order to get logical results when doing interpolation, we detect when a color is achromatic (or very close to achromatic) and set the hues to undefined. This helps us to identify achromatic cases and helps us to prevent weird color shifts when interpolating diff --git a/docs/src/markdown/api/index.md b/docs/src/markdown/api/index.md index eaae131a..5fc6f658 100644 --- a/docs/src/markdown/api/index.md +++ b/docs/src/markdown/api/index.md @@ -866,7 +866,7 @@ Parameters `colors` | | A list of color strings, [`Color`](#color) objects, dictionaries representing a color, [`stop`](#piecewise) objects, or easing functions. `space` | `#!py "lab"` | Color space to interpolate in. `out_space` | `#!py None` | Color space that the new color should be in. If `#!py None`, the return color will be in the same color space as specified by `space`. - `progress` | `#!py None` | An optional function that that allows for custom logic to perform non-linear interpolation. + `progress` | `#!py None` | An optional function that allows for custom logic to perform non-linear interpolation. `hue` | `#!py "shorter"` | Define how color spaces which have hue angles are interpolated. Default evaluates between the shortest angle. `premultiplied` | `#!py True` | Use premultiplied alpha when interpolating. `extrapolate` | `#!py False` | Interpolations should extrapolate when values exceed the domain range ([0, 1] by default). @@ -1003,7 +1003,7 @@ Description - Interpolates between two colors returning a color that represents the mixing of the base color and the provided `color` mixed at the provided `percent`, where `percent` applies to how much the provided `color` contributes to the - the final result. + final result. Parameters @@ -1012,7 +1012,7 @@ Parameters -------------------------- | ---------------------------------- | ----------- `color` | | A color string, [`Color`](#color) object, or dictionary representing a color. `percent` | `#!py 0.5` | A numerical value between 0 - 1 representing the percentage at which the parameter `color` will be mixed. - `in_place` | `#!py False` | Boolean used to determine if the the current color should be modified "in place" or a new [`Color`](#color) object should be returned. + `in_place` | `#!py False` | Boolean used to determine if the current color should be modified "in place" or a new [`Color`](#color) object should be returned. `#!py **interpolate_args` | See\ [`interpolate`](#interpolate) | Keyword arguments defined in [`interpolate`](#interpolate). Return @@ -1113,7 +1113,7 @@ Parameters `name` | | The name of the filter that should be applied. `amount` | See\ above | A numerical value adjusting to what degree the filter is applied. Input range can vary depending on the filter being used. Default can also dependent on the filter being used. `space` | `#!py3 None` | Controls the algorithm used for simulating the given CVD. - `in_place` | `#!py3 False` | Boolean used to determine if the the current color should be modified "in place" or a new [`Color`](#color) object should be returned. + `in_place` | `#!py3 False` | Boolean used to determine if the current color should be modified "in place" or a new [`Color`](#color) object should be returned. `out_space` | `#!py None` | Color space that the new color should be in. If `#!py None`, the return color will be in the same color space as specified via `space`. `**kwargs` | | Additional filter specific parameters. @@ -1237,7 +1237,7 @@ Parameters `operator` | `#!py3 None` | A Porter Duff operator to use for alpha compositing. Values should be a string specifying the name of the operator to use. If `#!py None`, [`source-over`](#source-over) will be used. If `#!py False`, alpha compositing will be skipped. `space` | `#!py3 None` | A color space to perform the overlay in. If `#!py None`, the base color's space will be used. `out_space` | `#!py None` | Color space that the new color should be in. If `#!py None`, the return color will be in the same color space as specified by `space`. - `in_place` | `#!py3 False` | Boolean used to determine if the the current color should be modified "in place" or a new [`Color`](#color) object should be returned. + `in_place` | `#!py3 False` | Boolean used to determine if the current color should be modified "in place" or a new [`Color`](#color) object should be returned. Return diff --git a/docs/src/markdown/cat.md b/docs/src/markdown/cat.md index 4c10c30e..24269499 100644 --- a/docs/src/markdown/cat.md +++ b/docs/src/markdown/cat.md @@ -56,7 +56,7 @@ Row([color_d50, color_d65]) ``` In order to account for the differences in illuminants, we use chromatic adaptation to modify the chromaticities of the -color so that that they account for the different illuminant and appear as they should under the new light source. This +color so that they account for the different illuminant and appear as they should under the new light source. This happens automatically when we do call `convert()`. We can see that the white point gets adjusted such that the D50 white looks like the D65 white when in sRGB and D65 white looks like D50 white under Pro Photo. diff --git a/docs/src/markdown/color.md b/docs/src/markdown/color.md index c77b56f7..acbce308 100644 --- a/docs/src/markdown/color.md +++ b/docs/src/markdown/color.md @@ -148,8 +148,8 @@ If you'd like to generate a random color, simply call `Color.random` with a give Ranges are based on the color space's defined channel range. For color spaces with defined gamuts, the values will be confined to appropriate ranges. For color space's without defined gamuts, the ranges may be quite arbitrary in some -cases. For color spaces with no hard, defined gamut, or gamuts that that far exceed practical usage it is recommend to -fit the colors to whatever gamut you'd like, or simply use a target space with a clear defined gamut. +cases. For color spaces with no hard, defined gamut, or gamuts that far exceed practical usage it is recommend to fit +the colors to whatever gamut you'd like, or simply use a target space with a clear defined gamut. ```py play Color.random('lab').fit('srgb') diff --git a/docs/src/markdown/colors/cam16_jmh.md b/docs/src/markdown/colors/cam16_jmh.md index 5f54ef77..1278aefa 100644 --- a/docs/src/markdown/colors/cam16_jmh.md +++ b/docs/src/markdown/colors/cam16_jmh.md @@ -65,7 +65,7 @@ Viewing\ Conditions | Description ---------------------- | ----------- White | This is the white point and should be the same as defined in the color class. This is provided as (x, y) chromaticity coordinates. Adapting\ Luminance | The luminance of the adapting field (`La`). The units are in cd/m2. -Background\ Luminance | The background luminance (`Yb`) the relative luminance of the nearby background (out to 10°), relative to the the reference white's luminance (`Y`). Usually 20 providing a gray world assumption. +Background\ Luminance | The background luminance (`Yb`) the relative luminance of the nearby background (out to 10°), relative to the reference white's luminance (`Y`). Usually 20 providing a gray world assumption. Surround | A description of the peripheral area. Use "dark" for a movie theater, "dim" for e.g. viewing a bright television in a dimly lit room, or "average" for surface colors. Discounting | Discounts the illuminant. If true, the eye is assumed to be fully adapted to the illuminant. Otherwise, the degree of discounting is based on other parameters. When the eye is not fully adapted, it can affect the way colors appear and the chromatic response. diff --git a/docs/src/markdown/colors/zcam_jmh.md b/docs/src/markdown/colors/zcam_jmh.md index cb83eda3..aadcdac8 100644 --- a/docs/src/markdown/colors/zcam_jmh.md +++ b/docs/src/markdown/colors/zcam_jmh.md @@ -70,7 +70,7 @@ Viewing\ Conditions | Description White | This is the white point and output white and should be the same as defined in the color class. This is provided as (x, y) chromaticity coordinates. ZCAM expects and was designed for this to be D65. Reference\ White | The absolute reference white where `Yw` is scaled to the luminance. Adapting\ Luminance | The luminance of the adapting field (`La`). The units are in cd/m2. -Background\ Luminance | The background luminance (`Yb`) the relative luminance of the nearby background (out to 10°), relative to the the reference white's luminance (`Y`). Usually 20 providing a gray world assumption. +Background\ Luminance | The background luminance (`Yb`) the relative luminance of the nearby background (out to 10°), relative to the reference white's luminance (`Y`). Usually 20 providing a gray world assumption. Surround | A description of the peripheral area. Use "dark" for a movie theater, "dim" for e.g. viewing a bright television in a dimly lit room, or "average" for surface colors. Discounting | Discounts the illuminant. If true, the eye is assumed to be fully adapted to the illuminant. Otherwise, the degree of discounting is based on other parameters. When the eye is not fully adapted, it can affect the way colors appear and the chromatic response. diff --git a/docs/src/markdown/compositing.md b/docs/src/markdown/compositing.md index 3c8fdffc..5d22ccbd 100644 --- a/docs/src/markdown/compositing.md +++ b/docs/src/markdown/compositing.md @@ -16,7 +16,7 @@ future time. /// new | New in 4.0 -A new `layer` method was added which uses a more intuitive name and aligns with how how multiple colors are handled in +A new `layer` method was added which uses a more intuitive name and aligns with how multiple colors are handled in other similar APIs such as `average()`, `interpolate()`, etc. /// diff --git a/docs/src/markdown/demos/3d_models.html b/docs/src/markdown/demos/3d_models.html index d32ff299..f2cc2735 100644 --- a/docs/src/markdown/demos/3d_models.html +++ b/docs/src/markdown/demos/3d_models.html @@ -481,7 +481,7 @@