# Auto-generated by `python -m gen` — do not edit manually.

from typing import TYPE_CHECKING, Generic, Literal

import bpy

from ...builder import BaseNode, SocketAccessor

from ...types import (
    InputBoolean,
    InputBundle,
    InputClosure,
    InputColor,
    InputFloat,
    InputInteger,
    InputMenu,
    InputRotation,
    InputShader,
    InputVector,
    InputAny,
)

from ...builder.socket import (
    BooleanSocket,
    BundleSocket,
    ClosureSocket,
    ColorSocket,
    FloatSocket,
    IntegerSocket,
    MenuSocket,
    RotationSocket,
    ShaderSocket,
    VectorSocket,
    _T,
    _S,
)


class CombineColor(BaseNode):
    """
    Create a color from individual components using multiple models

    Parameters
    ----------
    red : InputFloat
        Red
    green : InputFloat
        Green
    blue : InputFloat
        Blue

    Inputs
    ------
    i.red : FloatSocket
        Red
    i.green : FloatSocket
        Green
    i.blue : FloatSocket
        Blue

    Outputs
    -------
    o.color : ColorSocket
        Color
    """

    _bl_idname = "ShaderNodeCombineColor"
    node: bpy.types.ShaderNodeCombineColor

    class _Inputs(SocketAccessor):
        red: FloatSocket
        """Red"""
        green: FloatSocket
        """Green"""
        blue: FloatSocket
        """Blue"""

    class _Outputs(SocketAccessor):
        color: ColorSocket
        """Color"""

    if TYPE_CHECKING:

        @property
        def i(self) -> _Inputs: ...
        @property
        def o(self) -> _Outputs: ...

    def __init__(
        self,
        red: InputFloat = 0.0,
        green: InputFloat = 0.0,
        blue: InputFloat = 0.0,
        *,
        mode: Literal["RGB", "HSV", "HSL"] = "RGB",
    ):
        super().__init__()
        key_args = {"Red": red, "Green": green, "Blue": blue}
        self.mode = mode
        self._establish_links(**key_args)

    @classmethod
    def rgb(
        cls, red: InputFloat = 0.0, green: InputFloat = 0.0, blue: InputFloat = 0.0
    ) -> "CombineColor":
        """Create Combine Color with operation 'RGB'. Use RGB (Red, Green, Blue) color processing"""
        return cls(mode="RGB", red=red, green=green, blue=blue)

    @classmethod
    def hsv(
        cls, red: InputFloat = 0.0, green: InputFloat = 0.0, blue: InputFloat = 0.0
    ) -> "CombineColor":
        """Create Combine Color with operation 'HSV'. Use HSV (Hue, Saturation, Value) color processing"""
        return cls(mode="HSV", red=red, green=green, blue=blue)

    @classmethod
    def hsl(
        cls, red: InputFloat = 0.0, green: InputFloat = 0.0, blue: InputFloat = 0.0
    ) -> "CombineColor":
        """Create Combine Color with operation 'HSL'. Use HSL (Hue, Saturation, Lightness) color processing"""
        return cls(mode="HSL", red=red, green=green, blue=blue)

    @property
    def mode(self) -> Literal["RGB", "HSV", "HSL"]:
        return self.node.mode

    @mode.setter
    def mode(self, value: Literal["RGB", "HSV", "HSL"]):
        self.node.mode = value


class ImplicitConversion(BaseNode, Generic[_T]):
    """
    Implicitly convert the input value to a fixed socket type

    Parameters
    ----------
    value : InputColor
        Value

    Inputs
    ------
    i.value : ColorSocket
        Value

    Outputs
    -------
    o.value : ColorSocket
        Value
    """

    _bl_idname = "NodeImplicitConversion"
    node: bpy.types.NodeImplicitConversion

    class _Inputs(SocketAccessor, Generic[_S]):
        value: _S
        """Value"""

    class _Outputs(SocketAccessor, Generic[_S]):
        value: _S
        """Value"""

    if TYPE_CHECKING:

        @property
        def i(self) -> _Inputs[_T]: ...
        @property
        def o(self) -> _Outputs[_T]: ...

    def __init__(
        self,
        value: InputAny = None,
        *,
        data_type: Literal[
            "FLOAT",
            "INT",
            "BOOLEAN",
            "VECTOR",
            "RGBA",
            "MENU",
            "SHADER",
            "BUNDLE",
            "CLOSURE",
        ] = "RGBA",
    ):
        super().__init__()
        key_args = {"Value": value}
        self.data_type = data_type
        self._establish_links(**key_args)

    @classmethod
    def float(cls, value: InputFloat = 0.0) -> "ImplicitConversion[FloatSocket]":
        """Create Implicit Conversion with operation 'Float'."""
        return ImplicitConversion(data_type="FLOAT", value=value)

    @classmethod
    def integer(cls, value: InputInteger = 0) -> "ImplicitConversion[IntegerSocket]":
        """Create Implicit Conversion with operation 'Integer'."""
        return ImplicitConversion(data_type="INT", value=value)

    @classmethod
    def boolean(
        cls, value: InputBoolean = False
    ) -> "ImplicitConversion[BooleanSocket]":
        """Create Implicit Conversion with operation 'Boolean'."""
        return ImplicitConversion(data_type="BOOLEAN", value=value)

    @classmethod
    def vector(cls, value: InputVector = None) -> "ImplicitConversion[VectorSocket]":
        """Create Implicit Conversion with operation 'Vector'."""
        return ImplicitConversion(data_type="VECTOR", value=value)

    @classmethod
    def color(cls, value: InputColor = None) -> "ImplicitConversion[ColorSocket]":
        """Create Implicit Conversion with operation 'Color'."""
        return ImplicitConversion(data_type="RGBA", value=value)

    @classmethod
    def menu(cls, value: InputMenu = None) -> "ImplicitConversion[MenuSocket]":
        """Create Implicit Conversion with operation 'Menu'."""
        return ImplicitConversion(data_type="MENU", value=value)

    @classmethod
    def shader(cls, value: InputShader = None) -> "ImplicitConversion[ShaderSocket]":
        """Create Implicit Conversion with operation 'Shader'."""
        return ImplicitConversion(data_type="SHADER", value=value)

    @classmethod
    def bundle(cls, value: InputBundle = None) -> "ImplicitConversion[BundleSocket]":
        """Create Implicit Conversion with operation 'Bundle'."""
        return ImplicitConversion(data_type="BUNDLE", value=value)

    @classmethod
    def closure(cls, value: InputClosure = None) -> "ImplicitConversion[ClosureSocket]":
        """Create Implicit Conversion with operation 'Closure'."""
        return ImplicitConversion(data_type="CLOSURE", value=value)

    @property
    def data_type(
        self,
    ) -> Literal[
        "FLOAT",
        "INT",
        "BOOLEAN",
        "VECTOR",
        "RGBA",
        "MENU",
        "SHADER",
        "BUNDLE",
        "CLOSURE",
    ]:
        return self.node.data_type  # ty: ignore[invalid-return-type]

    @data_type.setter
    def data_type(
        self,
        value: Literal[
            "FLOAT",
            "INT",
            "BOOLEAN",
            "VECTOR",
            "RGBA",
            "MENU",
            "SHADER",
            "BUNDLE",
            "CLOSURE",
        ],
    ):
        self.node.data_type = value


class Mix(BaseNode):
    """
    Mix values by a factor

    Parameters
    ----------
    factor_float : InputFloat
        Factor
    factor_vector : InputVector
        Factor
    a_float : InputFloat
        A
    b_float : InputFloat
        B
    a_vector : InputVector
        A
    b_vector : InputVector
        B
    a_color : InputColor
        A
    b_color : InputColor
        B
    a_rotation : InputRotation
        A
    b_rotation : InputRotation
        B

    Inputs
    ------
    i.factor_float : FloatSocket
        Factor
    i.factor_vector : VectorSocket
        Factor
    i.a_float : FloatSocket
        A
    i.b_float : FloatSocket
        B
    i.a_vector : VectorSocket
        A
    i.b_vector : VectorSocket
        B
    i.a_color : ColorSocket
        A
    i.b_color : ColorSocket
        B
    i.a_rotation : RotationSocket
        A
    i.b_rotation : RotationSocket
        B

    Outputs
    -------
    o.result_float : FloatSocket
        Result
    o.result_vector : VectorSocket
        Result
    o.result_color : ColorSocket
        Result
    o.result_rotation : RotationSocket
        Result
    """

    _bl_idname = "ShaderNodeMix"
    node: bpy.types.ShaderNodeMix

    class _Inputs(SocketAccessor):
        factor_float: FloatSocket
        """Factor"""
        factor_vector: VectorSocket
        """Factor"""
        a_float: FloatSocket
        """A"""
        b_float: FloatSocket
        """B"""
        a_vector: VectorSocket
        """A"""
        b_vector: VectorSocket
        """B"""
        a_color: ColorSocket
        """A"""
        b_color: ColorSocket
        """B"""
        a_rotation: RotationSocket
        """A"""
        b_rotation: RotationSocket
        """B"""

    class _Outputs(SocketAccessor):
        result_float: FloatSocket
        """Result"""
        result_vector: VectorSocket
        """Result"""
        result_color: ColorSocket
        """Result"""
        result_rotation: RotationSocket
        """Result"""

    if TYPE_CHECKING:

        @property
        def i(self) -> _Inputs: ...
        @property
        def o(self) -> _Outputs: ...

    def __init__(
        self,
        factor_float: InputFloat = 1.0,
        factor_vector: InputVector = None,
        a_float: InputFloat = 0.0,
        b_float: InputFloat = 0.0,
        a_vector: InputVector = None,
        b_vector: InputVector = None,
        a_color: InputColor = None,
        b_color: InputColor = None,
        a_rotation: InputRotation = None,
        b_rotation: InputRotation = None,
        *,
        data_type: Literal["FLOAT", "VECTOR", "RGBA"] = "FLOAT",
        factor_mode: Literal["UNIFORM", "NON_UNIFORM"] = "UNIFORM",
        blend_type: Literal[
            "MIX",
            "DARKEN",
            "MULTIPLY",
            "BURN",
            "LIGHTEN",
            "SCREEN",
            "DODGE",
            "ADD",
            "OVERLAY",
            "SOFT_LIGHT",
            "LINEAR_LIGHT",
            "DIFFERENCE",
            "EXCLUSION",
            "SUBTRACT",
            "DIVIDE",
            "HUE",
            "SATURATION",
            "COLOR",
            "VALUE",
        ] = "MIX",
        clamp_factor: bool = False,
        clamp_result: bool = False,
    ):
        super().__init__()
        key_args = {
            "Factor_Float": factor_float,
            "Factor_Vector": factor_vector,
            "A_Float": a_float,
            "B_Float": b_float,
            "A_Vector": a_vector,
            "B_Vector": b_vector,
            "A_Color": a_color,
            "B_Color": b_color,
            "A_Rotation": a_rotation,
            "B_Rotation": b_rotation,
        }
        self.data_type = data_type
        self.factor_mode = factor_mode
        self.blend_type = blend_type
        self.clamp_factor = clamp_factor
        self.clamp_result = clamp_result
        self._establish_links(**key_args)

    @classmethod
    def float(cls, factor: InputFloat = 1.0, b: InputFloat = 0.0) -> "Mix":
        """Create Mix with operation 'Float'."""
        return cls(data_type="FLOAT", factor_float=factor, b_float=b)

    @classmethod
    def vector(cls, factor: InputFloat = 1.0, b: InputVector = None) -> "Mix":
        """Create Mix with operation 'Vector'."""
        return cls(data_type="VECTOR", factor_float=factor, b_vector=b)

    @classmethod
    def color(cls, factor: InputFloat = 1.0, b_color: InputColor = None) -> "Mix":
        """Create Mix with operation 'Color'."""
        return cls(data_type="RGBA", factor_float=factor, b_color=b_color)

    @property
    def data_type(self) -> Literal["FLOAT", "VECTOR", "RGBA"]:
        return self.node.data_type  # ty: ignore[invalid-return-type]

    @data_type.setter
    def data_type(self, value: Literal["FLOAT", "VECTOR", "RGBA"]):
        self.node.data_type = value

    @property
    def factor_mode(self) -> Literal["UNIFORM", "NON_UNIFORM"]:
        return self.node.factor_mode

    @factor_mode.setter
    def factor_mode(self, value: Literal["UNIFORM", "NON_UNIFORM"]):
        self.node.factor_mode = value

    @property
    def blend_type(
        self,
    ) -> Literal[
        "MIX",
        "DARKEN",
        "MULTIPLY",
        "BURN",
        "LIGHTEN",
        "SCREEN",
        "DODGE",
        "ADD",
        "OVERLAY",
        "SOFT_LIGHT",
        "LINEAR_LIGHT",
        "DIFFERENCE",
        "EXCLUSION",
        "SUBTRACT",
        "DIVIDE",
        "HUE",
        "SATURATION",
        "COLOR",
        "VALUE",
    ]:
        return self.node.blend_type

    @blend_type.setter
    def blend_type(
        self,
        value: Literal[
            "MIX",
            "DARKEN",
            "MULTIPLY",
            "BURN",
            "LIGHTEN",
            "SCREEN",
            "DODGE",
            "ADD",
            "OVERLAY",
            "SOFT_LIGHT",
            "LINEAR_LIGHT",
            "DIFFERENCE",
            "EXCLUSION",
            "SUBTRACT",
            "DIVIDE",
            "HUE",
            "SATURATION",
            "COLOR",
            "VALUE",
        ],
    ):
        self.node.blend_type = value

    @property
    def clamp_factor(self) -> bool:
        return self.node.clamp_factor

    @clamp_factor.setter
    def clamp_factor(self, value: bool):
        self.node.clamp_factor = value

    @property
    def clamp_result(self) -> bool:
        return self.node.clamp_result

    @clamp_result.setter
    def clamp_result(self, value: bool):
        self.node.clamp_result = value


class RGBToBW(BaseNode):
    """
    Convert a color's luminance to a grayscale value

    Parameters
    ----------
    color : InputColor
        Color

    Inputs
    ------
    i.color : ColorSocket
        Color

    Outputs
    -------
    o.val : FloatSocket
        Val
    """

    _bl_idname = "ShaderNodeRGBToBW"
    node: bpy.types.ShaderNodeRGBToBW

    class _Inputs(SocketAccessor):
        color: ColorSocket
        """Color"""

    class _Outputs(SocketAccessor):
        val: FloatSocket
        """Val"""

    if TYPE_CHECKING:

        @property
        def i(self) -> _Inputs: ...
        @property
        def o(self) -> _Outputs: ...

    def __init__(self, color: InputColor = None):
        super().__init__()
        key_args = {"Color": color}

        self._establish_links(**key_args)


class SeparateColor(BaseNode):
    """
    Split a color into its individual components using multiple models

    Parameters
    ----------
    color : InputColor
        Color

    Inputs
    ------
    i.color : ColorSocket
        Color

    Outputs
    -------
    o.red : FloatSocket
        Red
    o.green : FloatSocket
        Green
    o.blue : FloatSocket
        Blue
    """

    _bl_idname = "ShaderNodeSeparateColor"
    node: bpy.types.ShaderNodeSeparateColor

    class _Inputs(SocketAccessor):
        color: ColorSocket
        """Color"""

    class _Outputs(SocketAccessor):
        red: FloatSocket
        """Red"""
        green: FloatSocket
        """Green"""
        blue: FloatSocket
        """Blue"""

    if TYPE_CHECKING:

        @property
        def i(self) -> _Inputs: ...
        @property
        def o(self) -> _Outputs: ...

    def __init__(
        self,
        color: InputColor = None,
        *,
        mode: Literal["RGB", "HSV", "HSL"] = "RGB",
    ):
        super().__init__()
        key_args = {"Color": color}
        self.mode = mode
        self._establish_links(**key_args)

    @classmethod
    def rgb(cls, color: InputColor = None) -> "SeparateColor":
        """Create Separate Color with operation 'RGB'. Use RGB (Red, Green, Blue) color processing"""
        return cls(mode="RGB", color=color)

    @classmethod
    def hsv(cls, color: InputColor = None) -> "SeparateColor":
        """Create Separate Color with operation 'HSV'. Use HSV (Hue, Saturation, Value) color processing"""
        return cls(mode="HSV", color=color)

    @classmethod
    def hsl(cls, color: InputColor = None) -> "SeparateColor":
        """Create Separate Color with operation 'HSL'. Use HSL (Hue, Saturation, Lightness) color processing"""
        return cls(mode="HSL", color=color)

    @property
    def mode(self) -> Literal["RGB", "HSV", "HSL"]:
        return self.node.mode

    @mode.setter
    def mode(self, value: Literal["RGB", "HSV", "HSL"]):
        self.node.mode = value


class ShaderToRGB(BaseNode):
    """
        Convert rendering effect (such as light and shadow) to color. Typically used for non-photorealistic rendering, to apply additional effects on the output of BSDFs.
    Note: only supported in EEVEE

        Parameters
        ----------
        shader : InputShader
            Shader

        Inputs
        ------
        i.shader : ShaderSocket
            Shader

        Outputs
        -------
        o.color : ColorSocket
            Color
        o.alpha : FloatSocket
            Alpha
    """

    _bl_idname = "ShaderNodeShaderToRGB"
    node: bpy.types.ShaderNodeShaderToRGB

    class _Inputs(SocketAccessor):
        shader: ShaderSocket
        """Shader"""

    class _Outputs(SocketAccessor):
        color: ColorSocket
        """Color"""
        alpha: FloatSocket
        """Alpha"""

    if TYPE_CHECKING:

        @property
        def i(self) -> _Inputs: ...
        @property
        def o(self) -> _Outputs: ...

    def __init__(self, shader: InputShader = None):
        super().__init__()
        key_args = {"Shader": shader}

        self._establish_links(**key_args)


class Wavelength(BaseNode):
    """
    Convert a wavelength value to an RGB value

    Parameters
    ----------
    wavelength : InputFloat
        Wavelength

    Inputs
    ------
    i.wavelength : FloatSocket
        Wavelength

    Outputs
    -------
    o.color : ColorSocket
        Color
    """

    _bl_idname = "ShaderNodeWavelength"
    node: bpy.types.ShaderNodeWavelength

    class _Inputs(SocketAccessor):
        wavelength: FloatSocket
        """Wavelength"""

    class _Outputs(SocketAccessor):
        color: ColorSocket
        """Color"""

    if TYPE_CHECKING:

        @property
        def i(self) -> _Inputs: ...
        @property
        def o(self) -> _Outputs: ...

    def __init__(self, wavelength: InputFloat = 500.0):
        super().__init__()
        key_args = {"Wavelength": wavelength}

        self._establish_links(**key_args)
