Skip to content

Latest commit

 

History

History
154 lines (119 loc) · 4.66 KB

colour.md

File metadata and controls

154 lines (119 loc) · 4.66 KB

Colour

Represents a colour from the API.

Attributes

  • cmyk (CMYK)
    Returns a class holding the CMYK values of the colour.
  • gradient (Image)
    Returns an image showing all possible gradients of the colour. Alias for ColourImages.gradient.
  • hex (Hex)
    Returns a class holding the hex value of the colour.
  • hsl (HSL)
    Returns a class holding the HSL values of the colour.
  • image (str) The image of the colour. Alias for ColourImages.square.
  • images (ColourImages)
    Returns a class holding different images of the colour. Use .square and .gradient attributes to access each image.
  • int (int) The integer value of the colour.
  • name (str)
    The name of the colour.
  • rgb (RGB)
    Returns a class holding the RGB values of the colour.
  • safe_text_colour (SafeTextColour)
    Returns a class holding the safe text colour for readability on images, etc.
  • shades (List[str]) The shades of the colour.
  • square (Image)
    Returns a square image of the colour. Alias for ColourImages.square.
  • tints (List[str]) The tints of the colour.
  • websafe (Colour)
    Returns a class holding the websafe version of the colour (for legacy browser support).

ColourImages

Represents a class holding different images of a Colour.

Attributes

  • colour (Colour) The colour this class is associated with.
  • gradient (Image)
    Returns an image with all possible gradients of the colour.
  • square (Image)
    Returns a square image of the colour.

ColourWebSafe

Represents a websafe version of a Colour but with the websafe attribute returning the same class for infinite recursion reasons.

CMYK

Represents a class holding the CMYK values of a Colour.

Attributes

  • string (str) The CMYK value as a string.
  • values (List[int])
    The CMYK values as a list of integers.
  • c (int) The cyan value.
  • m (int) The magenta value.
  • y (int) The yellow value.
  • k (int) The black value.

RGB

Represents a class holding RGB values of a Colour.

Attributes

  • r (int))
    The red value.
  • g (int))
    The green value.
  • b (int))
    The blue value.
  • string (str))
    The RGB value as a string.
  • values (List[int])
    The RGB values as a list of integers.

Hex

Represents a class holding information about a colour's hex value.

Attributes

  • string (str) The hex value as a string.
  • values (List[str])
    The hex value split into a list (two characters per item).
  • clean (str) The hex value without the #.
  • shorten (Optional[str]) The shortened hex value, if available.

HSL

Represents a class holding HSL values of a Colour.

Attributes

  • string (str) The HSL value as a string.
  • values (List[int]) The HSL values as a list of integers.
  • h (int) The hue value.
  • s (int)
    The saturation value.
  • l (int) The lightness value.

SafeTextColour

Represents a class holding the "safe" version of a Colour for text readability.

Attributes

  • name (str): The name of the colour.
  • hex (str): The hex value of the colour.
  • rgb (SafeTextColourRGB): The RGB values of the colour.

SafeTextColourRGB

Represents a class holding RGB values of a SafeTextColour.

Attributes

  • r (int) The red value.
  • g (int) The green value.
  • b (int)
    The blue value.
  • values (List[int])
    The RGB values as a list of integers.