Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
lgc2333 committed Oct 4, 2024
1 parent bff1b75 commit 6195116
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,10 @@ Telegram:[@lgc2333](https://t.me/lgc2333)

## 📝 更新日志

### 0.4.2

- 修复 [#7](https://github.com/lgc-NB2Dev/nonebot-plugin-color/issues/7) (可能)

### 0.4.1

- 添加配置 `COLOR_TEXT_BLACK_N_WHITE` 以使图片中文字仅为黑色和白色
Expand Down
2 changes: 1 addition & 1 deletion nonebot_plugin_color/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from . import __main__ as __main__ # noqa: E402
from .config import ConfigModel # noqa: E402

__version__ = "0.4.1"
__version__ = "0.4.2"
__plugin_meta__ = PluginMetadata(
name="色图生成",
description="用于生成指定色彩图片的 NoneBot2 插件",
Expand Down
9 changes: 5 additions & 4 deletions nonebot_plugin_color/data_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,18 @@
PyDanticColorTuple = Union[Tuple[int, int, int], Tuple[int, int, int, float]]

if PYDANTIC_V2:
from pydantic_core import PydanticCustomError as ColorError

try:
from pydantic_core import PydanticCustomError as ColorError
from pydantic_extra_types.color import Color
except ImportError:
logger.warning(
"Missing suggested dependency, "
"please use `pip install nonebot-plugin-color[pyd2]` to install",
)
logger.warning("Fallback to pydantic v1 Color class")
from pydantic.v1.color import Color
from pydantic.v1.errors import ColorError
logger.warning("Fallback to pydantic deprecated Color class")
from pydantic.color import Color

else:
from pydantic.color import Color
from pydantic.errors import ColorError
Expand Down

0 comments on commit 6195116

Please sign in to comment.