.. Automatically generated file - do not modify.

.. class:: Color(color=None, hls=None, hsv=None, rgb=None, alpha=1.0)
    
    The Color class is used to represent and manipulate colors and convert
    between various color spaces. It also represents opacity in the form
    of an alpha.
    
    When creating a Color, at one of the `color`, `hls`, `hsv`, or `rgb`
    arguments should be supplied. (If all are None, None is returned.)
    
    `color`
        The color, in one of the standard formats Ren'Py understands. These
        are:
    
        * A Color object.
        * An (r, g, b) or (r, g, b, a) tuple, in which all the numbers are
          between 0 and 255.
        * A string giving a hexadecimal color, in the form "#rgb", "#rgba",
          "#rrggbb", or "#rrggbbaa".
    
    `hls`
        A color in the hue-lightness-saturation color space. This should
        be supplied a three-component tuple, where each component is between
        0.0 and 1.0.
    
    `hsv`
        A color in the hue-saturation-value color space. This should
        be supplied a three-component tuple, where each component is between
        0.0 and 1.0.
    
    `rgb`
        A color in the red-green-blue color space. This should
        be supplied a three-component tuple, where each component is between
        0.0 and 1.0.
    
    If the supplied color does not contain an alpha value, `alpha` is used.
    `alpha` must be between 0.0 and 1.0.
    
    Color objects can be used as 4-component tuples, where the components
    are (red, green, blue, and alpha). When used as a tuple, the value
    of each component is between 0 and 255.
    
    Color objects support the +, -, and * operators, representing
    component-wise addition, subtraction, and multiplication. Some uses
    of these operators can cause the creation of colors with components
    that are not in the supported range. Such colors should not be passed
    to other parts of Ren'Py. (The normalize method can be called to return
    a new color with the components limited to the proper range.)
    
    A Color object has the following properties:
    
    .. attribute:: hls
    
        Returns the color as a tuple of three floating point numbers giving
        hue, lightness, and saturation. Each component ranges between 0.0 and 1.0.
    
    .. attribute:: hsv
    
        Returns the color as a tuple of three floating point numbers giving
        hue, saturation, and value. Each component ranges between 0.0 and 1.0.
    
    .. attribute:: rgb
    
        Returns the color as a tuple of three floating point numbers giving
        the red, green, and blue components. Each component ranges between 0.0
        and 1.0.
    
    .. attribute:: alpha
    
        Returns the alpha (opacity) of this Color as a number between 0.0 and
        1.0, where 0.0 is transparent and 1.0 is opaque.
    
    .. attribute:: hexcode
    
        Returns a string containing a hex color code of the form #rrggbbaa
        or #rrggbb.
    
    Color objects have the following methods. Since Colors are immutable,
    these methods always return a new Color object.

    .. method:: interpolate(other, fraction)
        
        Interpolates between this Color and `other` in the RGB color
        space, returning a new Color as the result. If `fraction` is 0.0, the
        result is the same as this color, if 1.0, it is the same as `other`.
    
    .. method:: interpolate_hls(other, fraction)
        
        Interpolates between this Color and `other` in the HLS color
        space, returning a new Color as the result. If `fraction` is 0.0, the
        result is the same as this color, if 1.0, it is the same as `other`.
        
        `other` may be a string, Color or an HLS tuple.
    
    .. method:: interpolate_hsv(other, fraction)
        
        Interpolates between this Color and `other` in the HSV color
        space, returning a new Color as the result. If `fraction` is 0.0, the
        result is the same as this color, if 1.0, it is the same as `other`.
        
        `other` may be a string, Color or an HSV tuple.
    
    .. method:: multiply_hls_saturation(saturation)
        
        Multiplies this color's saturation by `saturation`, and returns
        the result as a new Color. This is performed in the HLS color space.
    
    .. method:: multiply_hsv_saturation(saturation)
        
        Multiplies this color's saturation by `saturation`, and returns
        the result as a new Color. This is performed in the HSV color space.
    
    .. method:: multiply_value(value)
        
        Multiples this color's value by `value` and returns the result as a
        new Color. This is performed in the HSV color space.
    
    .. method:: normalize(self)
        
        Returns a normalized version of this Color where all components fall
        between 0 and 255.
    
    .. method:: opacity(opacity)
        
        Multiplies the alpha channel of this color by `opacity`, and returns
        the new color.
    
    .. method:: replace_hls_saturation(saturation)
        
        Replaces this color's saturation with `saturation`, and returns
        the result as a new Color. This is performed in the HLS color space.
    
    .. method:: replace_hsv_saturation(saturation)
        
        Replace this color's saturation with `saturation`, and returns
        the result as a new Color. This is performed in the HSV color space.
    
    .. method:: replace_hue(hue)
        
        Replaces this color's hue with `hue`, which should be between 0.0 and
        1.0. Returns the new Color.
    
    .. method:: replace_lightness(lightness)
        
        Replaces this color's lightness with `lightness`, and returns
        the result as a new Color. This is performed in the HLS color space.
    
    .. method:: replace_opacity(opacity)
        
        Replaces this color's alpha channel with `opacity`, and
        returns the result as a new Color.
    
    .. method:: replace_value(value)
        
        Replaces this color's value with `value` and returns the result as a
        new Color. This is performed in the HSV color space.
    
    .. method:: rotate_hue(rotation)
        
        Rotates this color's hue by `rotation`, and returns the new Color. `rotation`
        is a fraction of a full rotation, to convert degrees divide by 360.0.
    
    .. method:: shade(fraction)
        
        Creates a shade of this color by mixing it with black. `fraction` is
        the fraction of this color that is in the new color. If `fraction` is
        1.0, the color is unchanged, if 0.0, black is returned.
        
        The alpha channel is unchanged.
    
    .. method:: tint(fraction)
        
        Creates a tint of this color by mixing it with white. `fraction` is
        the fraction of this color that is in the new color. If `fraction` is
        1.0, the color is unchanged, if 0.0, white is returned.
        
        The alpha channel is unchanged.
    
