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
  • Hex to RGB
  • RGB to hex
  • Closest color name
  • Get color by name

Was this helpful?

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

Colors Functions

PreviousAnalysis FunctionsNextConversions Functions

Last updated 6 months ago

Was this helpful?

Available functions:

  • ColorManager.__init__(): Initializes the ColorManager with a predefined list of colors.

  • ColorManager.(hex_value): Converts a hex color code to an RGB tuple.

  • ColorManager.(r, g, b): Converts RGB values to a hex color code.

  • ColorManager.(hex_value): Finds the closest named color to the given hex value.

  • ColorManager.(name): Returns the hex and RGB values of a color based on its name.

To use ColorManager, you must first initialize it before use:

color_manager = ColorManager()


Hex to RGB

Converts a hex color code to an RGB tuple.

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 hex

Converts RGB values to a hex color code.

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").

Closest color name

Finds the closest named color to the given hex value.

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

Returns:
    str: The name of the closest color from the list.

Get color by name

Returns the hex and RGB values of a color based on its name.

Parameters:
    name (str): The name of the color to look up (e.g., "red").

Returns:
    dict: A dictionary containing:
        - 'Name' (str): The color name in title case.
        - 'Hex' (str): The uppercase hex value (e.g., "#FF0000").
        - 'RGB' (tuple): The RGB values (e.g., (255, 0, 0)).
hex_to_rgb
rgb_to_hex
closest_color_name
get_color_by_name