Documentation
Our WebsiteOur Github
  • 👋Welcome to Infinitode Documentation
  • AI Documentation
  • API Documentation
    • Basic Math API Documentation (#Experimental)
    • BMI Calculator API Documentation
    • Character Counter API Documentation
    • Chemical Equation Balancer API Documentation
    • Color Generator API Documentation
    • Date Difference Calculator API Documentation
    • Dungen API Documentation
    • Dungen Dev API Documentation
    • Factorial Calculator API Documentation
    • Fantasy Name Generator API Documentation
    • Fibonacci Sequence Generator API Documentation
    • GCD Calculator API Documentation
    • Hash API Documentation
    • Helix PSA API Documentation
    • LCM Calculator API Documentation
    • Leap Year Checker API Documentation
    • Lorem API Documentation
    • Molar Mass Calculator API Documentation (#Experimental)
    • MycoNom API Documentation
    • Name Generator API Documentation
    • Palindrome Checker API Documentation
    • Password Generator API Documentation
    • Password Strength Detector API Documentation
    • Periodic Table API Documentation
    • Prime Number Checker API Documentation
    • Quadratic Equation Solver API Documentation
    • Random Facts Generator API Documentation
    • Random Quotes Generator API Documentation
    • Roman Numeral Converter API Documentation
    • Simple Interest Calculator API Documentation
    • Slugify API Documentation
    • Text Case Converter API Documentation
    • Unit Converter API Documentation
    • Username Generator API Documentation
    • UUID Generator API Documentation
    • Vowel Counter API Documentation
  • Package Documentation
    • BlurJS Package Documentation
      • BlurJS Usage Examples
      • BlurJS Reference Documentation
    • CodeSafe Package Documentation
      • CodeSafe Reference
        • CodeSafe Functions
    • DeepDefend Package Documentation
      • DeepDefend Reference
        • Attacks Functions
        • Defenses Functions
    • DupliPy Package Documentation
      • DupliPy Reference
        • Formatting Functions
        • Replication Functions
        • Similarity Functions
        • Text Analysis Functions
    • FuncProfiler Package Documentation
      • FuncProfiler Reference
        • FuncProfiler Functions
    • Hued Package Documentation
      • Hued Reference
        • Analysis Functions
        • Colors Functions
        • Conversions Functions
        • Palettes Functions
    • LocalSiteMap Package Documentation
      • LocalSiteMap Reference
        • LocalSiteMap Functions
    • PyAutoPlot Package Documentation
      • PyAutoPlot Reference
        • PyAutoPlot Functions
    • PyWebScrapr Package Documentation
      • PyWebScrapr Reference
        • PyWebScrapr Functions
    • ValX Package Documentation
      • ValX Reference
        • ValX Functions
Powered by GitBook
On this page
  • RGB to HEX
  • HEX to RGB
  • RGB to HSL
  • HSL to RGB
  • RGB to HSV
  • HSV to RGB
  • RGB to CMYK
  • CMYK to RGB
  • HEX to HSL
  • HEX to HSV
  • HEX to CMYK
  • HSL to HEX
  • HSL to HSV
  • HSL to CMYK
  • HSV to HEX
  • HSV to HSL
  • HSV to CMYK
  • CMYK to HSV
  • CMYK to HSL
  • CMYK to HEX
  • RGB to XYZ
  • XYZ to RGB
  • HEX to XYZ
  • XYZ to HEX
  • HSL to XYZ
  • XYZ to HSL
  • HSV to XYZ
  • XYZ to HSV
  • CMYK to XYZ
  • XYZ to CMYK
  • Blend colors

Was this helpful?

  1. Package Documentation
  2. Hued Package Documentation
  3. Hued Reference

Conversions Functions

PreviousColors FunctionsNextPalettes Functions

Last updated 5 months ago

Was this helpful?

Available functions:

  • (r, g, b): Converts RGB to HEX.

  • (hex_value): Converts HEX to RGB.

  • (r, g, b): Converts RGB to HSL.

  • (h, s, l): Converts HSL to RGB.

  • (r, g, b): Converts RGB to HSV.

  • (h, s, v): Converts HSV to RGB.

  • (r, g, b): Converts RGB to CMYK.

  • (c, m, y, k): Converts CMYK to RGB.

  • (hex_value): Converts HEX to HSL.

  • (hex_value): Converts HEX to HSV.

  • (hex_value): Converts HEX to CMYK.

  • (hsl): Converts HSL to HEX.

  • (hsl): Converts HSL to HSV.

  • (hsl): Converts HSL to CMYK.

  • (hsv): Converts HSV to HEX.

  • (hsv): Converts HSV to HSL.

  • (hsv): Converts HSV to CMYK.

  • (cmyk): Converts CMYK to HEX.

  • (cmyk): Converts CMYK to HSL.

  • (cmyk): Converts CMYK to HSV.

  • (r, g, b): Converts RGB to XYZ.

  • (x, y, z): Converts XYZ to RGB.

  • (xyz): Converts XYZ to CMYK.

  • (xyz): Converts XYZ to HEX.

  • (xyz): Converts XYZ to HSL.

  • (xyz): Converts XYZ to HSV.

  • (hex): Converts HEX to XYZ.

  • (hsl): Converts HSL to XYZ.

  • (hsv): Converts HSV to XYZ.

  • (cmyk): Converts CMYK to XYZ.

  • (color1, color2, ratio=0.5): Blends two colors in the RGB format using the specified ratio.


RGB to HEX

Converts RGB to HEX

Parameters:
        r (int): Red value (0-255).
        g (int): Green value (0-255).
        b (int): Blue value (0-255).

Returns:
        str: A string representing the hex color code (e.g., "#FFFFFF").

HEX to RGB

Converts HEX to RGB

Parameters:
        hex_value (str): A string representing a hex color code (e.g., "#FFFFFF").

Returns:
        tuple: A tuple representing the RGB values (e.g., (255, 255, 255)).

RGB to HSL

Converts RGB to HSL.

Parameters:
        r (int): Red value (0-255).
        g (int): Green value (0-255).
        b (int): Blue value (0-255).

Returns:
        tuple: A tuple representing the HSL values (h, s, l) where
               h (float) is hue in the range [0, 360),
               s (float) is saturation in the range [0, 1],
               l (float) is lightness in the range [0, 1].

HSL to RGB

Converts HSL to RGB.

Parameters:
        h (float): Hue in the range [0, 360).
        s (float): Saturation in the range [0, 1].
        l (float): Lightness in the range [0, 1].

Returns:
        tuple: A tuple representing the RGB values (0-255).

RGB to HSV

Converts RGB to HSV.

Parameters:
        r (int): Red value (0-255).
        g (int): Green value (0-255).
        b (int): Blue value (0-255).

Returns:
        tuple: A tuple representing the HSV values (h, s, v) where
               h (float) is hue in the range [0, 360),
               s (float) is saturation in the range [0, 1],
               v (float) is value in the range [0, 1].

HSV to RGB

Converts HSV to RGB.

Parameters:
        h (float): Hue in the range [0, 360).
        s (float): Saturation in the range [0, 1].
        v (float): Value in the range [0, 1].

Returns:
        tuple: A tuple representing the RGB values (0-255).

RGB to CMYK

Converts RGB to CMYK.

Parameters:
        r (int): Red value (0-255).
        g (int): Green value (0-255).
        b (int): Blue value (0-255).

Returns:
        tuple: A tuple representing the CMYK values (c, m, y, k) where
               c (float) is cyan in the range [0, 1],
               m (float) is magenta in the range [0, 1],
               y (float) is yellow in the range [0, 1],
               k (float) is key/black in the range [0, 1].

CMYK to RGB

Converts CMYK to RGB.

Parameters:
        c (float): Cyan in the range [0, 1].
        m (float): Magenta in the range [0, 1].
        y (float): Yellow in the range [0, 1].
        k (float): Key/black in the range [0, 1].

Returns:
        tuple: A tuple representing the RGB values (0-255).

HEX to HSL

Converts HEX to HSL.

Parameters:
        hex_value (str): A string representing a hex color code (e.g., "#FFFFFF").

Returns:
        tuple: A tuple representing the HSL values (h, s, l) where
               h (float) is hue in the range [0, 360),
               s (float) is saturation in the range [0, 1],
               l (float) is lightness in the range [0, 1].

HEX to HSV

Converts HEX to HSV.

Parameters:
        hex_value (str): A string representing a hex color code (e.g., "#FFFFFF").

Returns:
        tuple: A tuple representing the HSV values (h, s, v) where
               h (float) is hue in the range [0, 360),
               s (float) is saturation in the range [0, 1],
               v (float) is value in the range [0, 1].

HEX to CMYK

Converts HEX to CMYK.

Parameters:
        hex_value (str): A string representing a hex color code (e.g., "#FFFFFF").

Returns:
        tuple: A tuple representing the CMYK values (c, m, y, k) where
               c (float) is cyan in the range [0, 1],
               m (float) is magenta in the range [0, 1],
               y (float) is yellow in the range [0, 1],
               k (float) is key/black in the range [0, 1].

HSL to HEX

Converts HSL to HEX.

Parameters:
        hsl_value (tuple): A tuple representing the HSL values (h, s, l) where
                           h (float) is hue in the range [0, 360),
                           s (float) is saturation in the range [0, 1],
                           l (float) is lightness in the range [0, 1].

Returns:
        str: A string representing the hex color code (e.g., "#FFFFFF").

Raises:
        ValueError: If the HSL values are out of range.

HSL to HSV

Converts HSL to HSV.

Parameters:
        hsl_value (tuple): A tuple representing the HSL values (h, s, l) where
                           h (float) is hue in the range [0, 360),
                           s (float) is saturation in the range [0, 1],
                           l (float) is lightness in the range [0, 1].

Returns:
        tuple: A tuple representing the HSV values (h, s, v) where
               h (float) is hue in the range [0, 360),
               s (float) is saturation in the range [0, 1],
               v (float) is value in the range [0, 1].

Raises:
        ValueError: If the HSL values are out of range.

HSL to CMYK

Converts HSL to CMYK.

Parameters:
        hsl_value (tuple): A tuple representing the HSL values (h, s, l) where
                           h (float) is hue in the range [0, 360),
                           s (float) is saturation in the range [0, 1],
                           l (float) is lightness in the range [0, 1].

Returns:
        tuple: A tuple representing the CMYK values (c, m, y, k) where
               c (float) is cyan in the range [0, 1],
               m (float) is magenta in the range [0, 1],
               y (float) is yellow in the range [0, 1],
               k (float) is key/black in the range [0, 1].

Raises:
        ValueError: If the HSL values are out of range.

HSV to HEX

Converts HSV to HEX.

Parameters:
        hsv_value (tuple): A tuple representing the HSV values (h, s, v) where
                           h (float) is hue in the range [0, 360),
                           s (float) is saturation in the range [0, 1],
                           v (float) is value in the range [0, 1].

Returns:
        str: A string representing the hex color code (e.g., "#FFFFFF").

Raises:
        ValueError: If the HSV values are out of range.

HSV to HSL

Converts HSV to HSL.

Parameters:
        hsv_value (tuple): A tuple representing the HSV values (h, s, v) where
                           h (float) is hue in the range [0, 360),
                           s (float) is saturation in the range [0, 1],
                           v (float) is value in the range [0, 1].

Returns:
        tuple: A tuple representing the HSL values (h, s, l) where
               h (float) is hue in the range [0, 360),
               s (float) is saturation in the range [0, 1],
               l (float) is lightness in the range [0, 1].

Raises:
        ValueError: If the HSV values are out of range.

HSV to CMYK

Converts HSV to CMYK.

Parameters:
        hsv_value (tuple): A tuple representing the HSV values (h, s, v) where
                           h (float) is hue in the range [0, 360),
                           s (float) is saturation in the range [0, 1],
                           v (float) is value in the range [0, 1].

Returns:
        tuple: A tuple representing the CMYK values (c, m, y, k) where
               c (float) is cyan in the range [0, 1],
               m (float) is magenta in the range [0, 1],
               y (float) is yellow in the range [0, 1],
               k (float) is key/black in the range [0, 1].

Raises:
        ValueError: If the HSV values are out of range.

CMYK to HSV

Converts CMYK to HSV.

Parameters:
        cmyk_value (tuple): A tuple representing the CMYK values (c, m, y, k) where
                            c (float) is cyan in the range [0, 1],
                            m (float) is magenta in the range [0, 1],
                            y (float) is yellow in the range [0, 1],
                            k (float) is key/black in the range [0, 1].

Returns:
        tuple: A tuple representing the HSV values (h, s, v) where
               h (float) is hue in the range [0, 360),
               s (float) is saturation in the range [0, 1],
               v (float) is value in the range [0, 1].

Raises:
        ValueError: If the CMYK values are out of range.

CMYK to HSL

Converts CMYK to HSL.

Parameters:
        cmyk_value (tuple): A tuple representing the CMYK values (c, m, y, k) where
                            c (float) is cyan in the range [0, 1],
                            m (float) is magenta in the range [0, 1],
                            y (float) is yellow in the range [0, 1],
                            k (float) is key/black in the range [0, 1].

Returns:
        tuple: A tuple representing the HSL values (h, s, l) where
               h (float) is hue in the range [0, 360),
               s (float) is saturation in the range [0, 1],
               l (float) is lightness in the range [0, 1].

Raises:
        ValueError: If the CMYK values are out of range.

CMYK to HEX

Converts CMYK to HEX.

Parameters:
        cmyk_value (tuple): A tuple representing the CMYK values (c, m, y, k) where
                            c (float) is cyan in the range [0, 1],
                            m (float) is magenta in the range [0, 1],
                            y (float) is yellow in the range [0, 1],
                            k (float) is key/black in the range [0, 1].

Returns:
        str: A string representing the hex color code (e.g., "#FFFFFF").

Raises:
        ValueError: If the CMYK values are out of range.

RGB to XYZ

Converts RGB to XYZ.

Parameters:
        r (int): Red component, in the range [0, 255].
        g (int): Green component, in the range [0, 255].
        b (int): Blue component, in the range [0, 255].

Returns:
        tuple: A tuple representing the XYZ values (x, y, z), where:
               x, y, z (float): Correspond to the CIE 1931 color space.

Raises:
        ValueError: If any RGB value is out of range.

XYZ to RGB

Converts XYZ to RGB.

Parameters:
        x (float): X component of the XYZ color space.
        y (float): Y component of the XYZ color space.
        z (float): Z component of the XYZ color space.

Returns:
        tuple: A tuple representing the RGB values (r, g, b), where:
               r, g, b (int): Red, Green, and Blue components, each in the range [0, 255].

Raises:
        ValueError: If any resulting RGB values are outside the valid range after conversion.

HEX to XYZ

Converts HEX to XYZ.

Parameters:
        hex_value (str): A hexadecimal color code (e.g., '#RRGGBB').

Returns:
        tuple: A tuple representing the XYZ values (x, y, z).

XYZ to HEX

Converts XYZ to HEX.

Parameters:
        xyz_value (tuple): A tuple of XYZ values (x, y, z).

Returns:
        str: A hexadecimal color code (e.g., '#RRGGBB').

HSL to XYZ

Converts HSL to XYZ.

Parameters:
        hsl_value (tuple): A tuple representing the HSL values (h, s, l).

Returns:
        tuple: A tuple representing the XYZ values (x, y, z).

XYZ to HSL

Converts XYZ to HSL.

Parameters:
        xyz_value (tuple): A tuple of XYZ values (x, y, z).

Returns:
        tuple: A tuple representing the HSL values (h, s, l).

HSV to XYZ

Converts HSV to XYZ.

Parameters:
        hsv_value (tuple): A tuple representing the HSV values (h, s, v).

Returns:
        tuple: A tuple representing the XYZ values (x, y, z).

XYZ to HSV

Converts XYZ to HSV.

Parameters:
        xyz_value (tuple): A tuple of XYZ values (x, y, z).

Returns:
        tuple: A tuple representing the HSV values (h, s, v).

CMYK to XYZ

Converts CMYK to XYZ.

Parameters:
        cmyk_value (tuple): A tuple of CMYK values (c, m, y, k).

Returns:
        tuple: A tuple representing the XYZ values (x, y, z).

XYZ to CMYK

Converts XYZ to CMYK.

Parameters:
        xyz_value (tuple): A tuple of XYZ values (x, y, z).

Returns:
        tuple: A tuple representing the CMYK values (c, m, y, k).

Blend colors

Blends two colors in the RGB format using the specified ratio.

Parameters:
        color1 (tuple): The first RGB color as a tuple of three integers (R, G, B).
        color2 (tuple): The second RGB color as a tuple of three integers (R, G, B).
        ratio (float, optional): The ratio to blend the colors. A value of 0.5 will
                                 blend both colors equally. Values closer to 0 will
                                 give more weight to `color1`, and values closer to
                                 1 will favor `color2`. Default is 0.5.

Returns:
        tuple: The blended color as an RGB tuple of three integers.

Example:
        >>> blend_colors((255, 0, 0), (0, 0, 255), 0.5)
        (127, 0, 127)
rgb_to_hex
hex_to_rgb
rgb_to_hsl
hsl_to_rgb
rgb_to_hsv
hsv_to_rgb
rgb_to_cmyk
cmyk_to_rgb
hex_to_hsl
hex_to_hsv
hex_to_cmyk
hsl_to_hex
hsl_to_hsv
hsl_to_cmyk
hsv_to_hex
hsv_to_hsl
hsv_to_cmyk
cmyk_to_hex
cmyk_to_hsl
cmyk_to_hsv
rgb_to_xyz
xyz_to_rgb
xyz_to_cmyk
xyz_to_hex
xyz_to_hsl
xyz_to_hsv
hex_to_xyz
hsl_to_xyz
hsv_to_xyz
cmyk_to_xyz
blend_colors