ComfyUI  >  Nodes  >  WAS Node Suite >  Hex to HSL

ComfyUI Node: Hex to HSL

Class Name

Hex to HSL

Category
WAS Suite/Utilities
Author
WASasquatch (Account age: 4688 days)
Extension
WAS Node Suite
Latest Updated
8/25/2024
Github Stars
1.1K

How to Install WAS Node Suite

Install this extension via the ComfyUI Manager by searching for  WAS Node Suite
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter WAS Node Suite in the search bar
After installation, click the  Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • High-speed GPU machines
  • 200+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 50+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Hex to HSL Description

Convert Hex color values to HSL format for intuitive color manipulation in digital art and design.

Hex to HSL:

The Hex to HSL node is designed to convert color values from the Hexadecimal (Hex) format to the Hue, Saturation, and Luminance (HSL) format. This conversion is essential for various applications in digital art and design, as HSL provides a more intuitive way to manipulate colors based on their visual properties. The node can handle both standard Hex colors and those with an alpha (transparency) component, making it versatile for different use cases. By converting Hex to HSL, you can easily adjust the hue, saturation, and luminance of colors, which is particularly useful for tasks like color correction, theme generation, and dynamic color adjustments in your artwork.

Hex to HSL Input Parameters:

hex_color

The hex_color parameter is the input Hex color value that you want to convert to HSL. This should be a string starting with a # followed by six or eight hexadecimal digits. The first six digits represent the red, green, and blue components of the color, while the optional last two digits represent the alpha (transparency) component. For example, #FF5733 represents an opaque color, while #FF573380 includes transparency. The function will strip the # and process the remaining digits to perform the conversion.

include_alpha

The include_alpha parameter is a boolean flag that indicates whether the alpha (transparency) component should be included in the output. If set to True, the function will consider the last two digits of the Hex color as the alpha value and include it in the HSL output. If set to False, the alpha value will be ignored, and the output will only include the hue, saturation, and luminance. The default value is False.

Hex to HSL Output Parameters:

hue

The hue parameter represents the color's hue in degrees, ranging from 0 to 360. It indicates the type of color, such as red, green, or blue, and is calculated based on the relative proportions of the red, green, and blue components in the Hex color.

saturation

The saturation parameter represents the color's saturation as a percentage, ranging from 0% to 100%. It indicates the intensity or purity of the color, with 0% being completely desaturated (gray) and 100% being fully saturated.

luminance

The luminance parameter represents the color's luminance as a percentage, ranging from 0% to 100%. It indicates the brightness of the color, with 0% being completely dark (black) and 100% being fully bright (white).

alpha

The alpha parameter represents the color's transparency as a decimal value, ranging from 0.0 to 1.0. It is only included if the include_alpha parameter is set to True. A value of 0.0 means fully transparent, while 1.0 means fully opaque.

hsl_string

The hsl_string parameter is a string representation of the HSL color, formatted as hsl(hue, saturation%, luminance%) or hsla(hue, saturation%, luminance%, alpha) if the alpha component is included. This string format is useful for CSS and other applications that require HSL color values.

Hex to HSL Usage Tips:

  • Use the include_alpha parameter to handle colors with transparency, especially when working with layered images or designs that require blending.
  • Convert Hex colors to HSL to easily adjust the hue, saturation, and luminance for color correction or theme generation in your artwork.
  • Utilize the hsl_string output for web design and CSS applications, where HSL values can be directly used to style elements.

Hex to HSL Common Errors and Solutions:

Invalid Hex Color Format

  • Explanation: The input Hex color does not start with # or contains invalid characters.
  • Solution: Ensure the Hex color string starts with # followed by six or eight valid hexadecimal digits.

Incorrect Alpha Length

  • Explanation: The Hex color string includes an alpha component but does not have exactly eight digits.
  • Solution: Verify that the Hex color string has eight digits if the alpha component is included, or set include_alpha to False.

Out of Range Values

  • Explanation: The calculated hue, saturation, or luminance values are out of their expected ranges.
  • Solution: This is unlikely to occur with valid Hex input. Ensure the input Hex color is correctly formatted and within the valid range.

Hex to HSL Related Nodes

Go back to the extension to check out more related nodes.
WAS Node Suite
RunComfy

© Copyright 2024 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals.