Analysis Functions

Available functions:

  • get_temperature(rgb): Determine the temperature of a color based on its RGB values.

  • is_neutral(rgb): Check if a color is neutral.

  • brightness(rgb): Calculate the brightness of a color.

  • is_pastel(rgb): Check if a color is pastel.

  • is_muted(rgb): Check if a color is muted.

  • is_vibrant(rgb): Check if a color is vibrant.

  • rgb_to_linear(rgb): Convert RGB values to linear RGB.

  • get_luminance(rgb): Calculate the relative luminance of an RGB color.

  • get_vibrancy(rgb): Calculate the vibrancy of an RGB color.

  • color_contrast(color1, color2): Calculates the contrast ratio between two colors using their RGB values.

  • get_text_color_from_background(background_color): Determines whether the text should be "light" or "dark" based on the background color.


Get temperature

Determine the temperature of a color based on its RGB values.

Parameters:
    rgb (tuple): A tuple containing the RGB values (r, g, b).

Returns:
    str: "Warm" if the color is warm, "Cool" if cool, or "Neutral" if neither.

Is neutral

Check if a color is neutral.

Brightness

Calculate the brightness of a color.

Is pastel

Check if a color is pastel.

Is muted

Check if a color is muted.

Is vibrant

Check if a color is vibrant.

RGB to linear

Convert RGB values to linear RGB.

Get luminance

Calculate the relative luminance of an RGB color.

Get vibrancy

Calculate the vibrancy of an RGB color.

Color contrast

Calculate the vibrancy of an RGB color.

Get text color from background

Determines whether the text should be "light" or "dark" based on the background color.

Last updated

Was this helpful?