Fix typehinting in colours.py
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "makegraph"
|
name = "makegraph"
|
||||||
version = "0.2.1"
|
version = "0.2.2"
|
||||||
description = "A custom python Matplotlib wrapper"
|
description = "A custom python Matplotlib wrapper"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
authors = [
|
authors = [
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ from .colours import ColourValue, ColourContainer
|
|||||||
from .uq_colours import UQ_COLOURS_DICT, UQ_COLOURS, add_colours_to_mpl
|
from .uq_colours import UQ_COLOURS_DICT, UQ_COLOURS, add_colours_to_mpl
|
||||||
from .makegraph import makeGraph, pltKeyClose
|
from .makegraph import makeGraph, pltKeyClose
|
||||||
|
|
||||||
__version__ = "0.2.1"
|
__version__ = "0.2.2"
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
"makeGraph", "pltKeyClose",
|
"makeGraph", "pltKeyClose",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# Better Colour Class for matplotlib
|
# Better Colour Class for matplotlib
|
||||||
|
|
||||||
__author__ = "Cal Wing"
|
__author__ = "Cal Wing"
|
||||||
__version__ = "0.0.1"
|
__version__ = "0.0.2"
|
||||||
|
|
||||||
from cycler import cycler, Cycler
|
from cycler import cycler, Cycler
|
||||||
from typing import Sequence, ItemsView, KeysView
|
from typing import Sequence, ItemsView, KeysView
|
||||||
@@ -41,7 +41,7 @@ class ColourValue(str):
|
|||||||
f"({self.rgba[0]:.2f}, {self.rgba[1]:.2f}, " \
|
f"({self.rgba[0]:.2f}, {self.rgba[1]:.2f}, " \
|
||||||
f"{self.rgba[2]:.2f}, {self.rgba[3]:.2f})>"
|
f"{self.rgba[2]:.2f}, {self.rgba[3]:.2f})>"
|
||||||
|
|
||||||
def alpha_adj(self, alpha):
|
def alpha_adj(self, alpha) -> tuple[float, float, float, float]:
|
||||||
r, g, b, _ = self.rgba
|
r, g, b, _ = self.rgba
|
||||||
return (r, g, b, alpha)
|
return (r, g, b, alpha)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user