Skip to content

Commit

Permalink
Merge branch 'upstream_master' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeByZach committed Aug 16, 2022
2 parents 2b8c0e4 + b71692e commit ba6cc79
Show file tree
Hide file tree
Showing 12 changed files with 56 additions and 31 deletions.
24 changes: 20 additions & 4 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,35 @@
# ColorHelper

## 6.0.3

- **FIX**: Fix registration of color spaces in custom color objects.

## 6.0.2

- **FIX**: Fix issue where default, dynamic color class wasn't always
properly.

## 6.0.1

- **FIX**: Fix absolute import reference that should have been relative.

## 6.0.0

> **WARNING**: We finally made it to a stable `coloraide` 1.x.x release,
> but some more unforeseen changes had to be made. This has been a long
> road to get the underlying color library to a stable state.
>
> - User created custom plugins may need refactoring again.
> - If you tweaked `add_to_default_spaces`, please compare against the
> default list as some plugins were renamed. Color space plugins that
> do not properly load should show log entries in the console.
> - User created custom plugins may need refactoring again, but most
> should be unaffected.
> - If you tweaked the new`add_to_default_spaces`, please compare against
> the default list as some plugins were renamed and user settings may
> need to get updated. Color space plugins that do not properly load
> should show log entries in the console.
- **NEW**: Upgraded to the stable `coloraide` 1.1. This should hopefully
eliminate API churn as it is now a stable release.
- **NEW**: Log when default color space loading fails.
- **FIX**: Fix color picker slider issue.

## 5.0.1

Expand Down
8 changes: 6 additions & 2 deletions ch_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,12 @@ def get_color_options(self, pt, rule):
continue
module = class_options.get("class", "ColorHelper.lib.coloraide.Color")
if isinstance(module, str):
# Initialize the color module and cache it for this view
color_class = util.import_color(module)
if module == "ColorHelper.lib.coloraide.Color":
# Use the base
color_class = self.base
else:
# Initialize the color module and cache it for this view
color_class = util.import_color(module)
class_options["class"] = color_class
else:
color_class = module
Expand Down
2 changes: 1 addition & 1 deletion ch_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@ def get_cursor_color(self):
bfr = self.view.substr(region)
obj = self.custom_color_class.match(bfr, fullmatch=True)
if obj is not None and obj.color.space() not in self.filters:
obj is None
obj = None
if obj is not None:
obj.start = region.begin()
obj.end = region.end()
Expand Down
16 changes: 8 additions & 8 deletions ch_picker.py
Original file line number Diff line number Diff line change
Expand Up @@ -502,20 +502,20 @@ def get_channel(self, channel, label, color_filter, mode='undefined'):
clone = self.color.clone()
show_alpha = color_filter == 'alpha'

coord = alg.no_nan(getattr(clone, color_filter))
coord = alg.no_nan(clone[color_filter])
if color_filter != 'hue':
rounded = alg.round_half_up(coord, 2 if mode != 'hsluv' else 0)
setattr(clone, color_filter, rounded)
clone[color_filter] = rounded
step = 0.01 * scale
else:
rounded = alg.round_half_up(coord / 359, 2) * 359
setattr(clone, color_filter, rounded)
clone[color_filter] = rounded
step = 3.59

first = True
while count:
coord = alg.no_nan(getattr(clone, color_filter)) - step
setattr(clone, color_filter, coord)
coord = alg.no_nan(clone[color_filter]) - step
clone[color_filter] = coord

if color_filter != "hue" and (coord < 0 or coord > (1 * scale)):
temp.append(self.get_spacer(width=count))
Expand Down Expand Up @@ -562,10 +562,10 @@ def get_channel(self, channel, label, color_filter, mode='undefined'):
count = 10

clone.update(self.color)
setattr(clone, color_filter, rounded)
clone[color_filter] = rounded
while count:
coord = alg.no_nan(getattr(clone, color_filter)) + step
setattr(clone, color_filter, coord)
coord = alg.no_nan(clone[color_filter]) + step
clone[color_filter] = coord

if color_filter != "hue" and (coord < 0 or coord > (1 * scale)):
html.append(self.get_spacer(width=count))
Expand Down
12 changes: 6 additions & 6 deletions ch_preview.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,12 +251,12 @@ def get_color_class(self, pt, classes):
if class_options is None:
continue
module = class_options.get("class", "ColorHelper.lib.coloraide.Color")
if module == "ColorHelper.lib.coloraide.Color":
color_class = self.base
class_options["class"] = color_class
elif isinstance(module, str):
# Initialize the color module and cache it for this view
color_class = util.import_color(module)
if isinstance(module, str):
if module == "ColorHelper.lib.coloraide.Color":
color_class = self.base
else:
# Initialize the color module and cache it for this view
color_class = util.import_color(module)
class_options["class"] = color_class
else:
color_class = module
Expand Down
2 changes: 1 addition & 1 deletion custom/ahex.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,4 @@ class ColorAlphaHex(get_base_color()):
"""Color object whose sRGB color space looks for colors of format `#RRGGBBAA` as `#AARRGGBB`."""


ColorAlphaHex.register(ASRGB, overwrite=True)
ColorAlphaHex.register(ASRGB(), overwrite=True)
2 changes: 1 addition & 1 deletion custom/ass_abgr.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,4 @@ class ColorAssABGR(get_base_color()):
"""Color class for ASS `ABGR` colors."""


ColorAssABGR.register(AssABGR, overwrite=True)
ColorAssABGR.register(AssABGR(), overwrite=True)
2 changes: 1 addition & 1 deletion custom/hex_0x.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ class ColorHex(get_base_color()):
"""Color object whose sRGB color space looks for colors of format `#RRGGBBAA` as `#AARRGGBB`."""


ColorHex.register(HexSRGB, overwrite=True)
ColorHex.register(HexSRGB(), overwrite=True)
2 changes: 1 addition & 1 deletion custom/tmtheme.py
Original file line number Diff line number Diff line change
Expand Up @@ -743,4 +743,4 @@ class ColorSRGBX11(get_base_color()):
"""Hex SRGB with X11 color names."""


ColorSRGBX11.register(SRGBX11, overwrite=True)
ColorSRGBX11.register(SRGBX11(), overwrite=True)
2 changes: 1 addition & 1 deletion lib/coloraide/interpolate/bspline_natural.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from .. interpolate import Interpolate, Interpolator
from functools import lru_cache
from .bspline import InterpolatorBSpline
from coloraide import algebra as alg
from .. import algebra as alg
from ..types import Vector, Matrix
from typing import List, Sequence, Any, Optional, Union, Mapping, Callable, Dict, Type, TYPE_CHECKING

Expand Down
13 changes: 9 additions & 4 deletions messages/recent.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,21 @@ prior releases.

A restart of Sublime Text is **strongly** encouraged.

Please report any issues as we _might_ have missed some required updates
related to the upgrade to stable `coloraide`.

## 6.0.0

> **WARNING**: We finally made it to a stable `coloraide` 1.x.x release,
> but some more unforeseen changes had to be made. This has been a long
> road to get the underlying color library to a stable state.
>
> - User created custom plugins may need refactoring again.
> - If you tweaked `add_to_default_spaces`, please compare against the
> default list as some plugins were renamed. Color space plugins that
> do not properly load should show log entries in the console.
> - User created custom plugins may need refactoring again, but most
> should be unaffected.
> - If you tweaked the new`add_to_default_spaces`, please compare against
> the default list as some plugins were renamed and user settings may
> need to get updated. Color space plugins that do not properly load
> should show log entries in the console.
- **NEW**: Upgraded to the stable `coloraide` 1.1. This should hopefully
eliminate API churn as it is now a stable release.
Expand Down
2 changes: 1 addition & 1 deletion support.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import webbrowser
import re

__version__ = "6.0.0"
__version__ = "6.0.3"
__pc_name__ = 'ColorHelper'

CSS = '''
Expand Down

0 comments on commit ba6cc79

Please sign in to comment.