Commit MaskBoxDetect node, which can automatically detect the position through the mask and output it to the composite node. Commit X,Y to Percent node to convert absolute coordinates to percent coordinates. Commit GaussianBlur node. Commit GetImageSize node.
42 lines
887 B
Python
42 lines
887 B
Python
|
|
from .imagefunc import Hex_to_RGB
|
|
|
|
mode_list = ['HEX', 'DEC']
|
|
|
|
class ColorPicker:
|
|
|
|
def __init__(self):
|
|
pass
|
|
|
|
@classmethod
|
|
def INPUT_TYPES(self):
|
|
|
|
return {
|
|
"required": {
|
|
"color": ("COLOR", {"default": "#FFFFFF"},),
|
|
"mode": (mode_list,), # 输出模式
|
|
},
|
|
"optional": {
|
|
}
|
|
}
|
|
|
|
RETURN_TYPES = ("STRING",)
|
|
RETURN_NAMES = ("value",)
|
|
FUNCTION = 'picker'
|
|
CATEGORY = '😺dzNodes/LayerUtility'
|
|
OUTPUT_NODE = True
|
|
|
|
def picker(self, color, mode):
|
|
ret = color
|
|
if mode == 'DEC':
|
|
ret = Hex_to_RGB(ret)
|
|
return (ret,)
|
|
|
|
|
|
NODE_CLASS_MAPPINGS = {
|
|
"LayerUtility: ColorPicker": ColorPicker
|
|
}
|
|
|
|
NODE_DISPLAY_NAME_MAPPINGS = {
|
|
"LayerUtility: ColorPicker": "LayerUtility: ColorPicker"
|
|
} |