Files
chflame163-ComfyUI_LayerStyle/py/color_picker.py
T
chflame163 3bf19861c6 Commit MaskBoxDetect, X,Y to Percent, GaussianBlur and GetImageSize nodes.
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.
2024-01-23 13:39:41 +08:00

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"
}