code: def ansi_density(color, density_standard):
      
      # Load the spec_XXXnm attributes into a Numpy array.
      sample = color.get_numpy_array()
      # Matrix multiplication
      intermediate = sample * density_standard
  
      # Sum the products.
      numerator = intermediate.sum()
      # This is the denominator in the density equation.
      sum_of_standard_wavelengths = density_standard.sum()
  
      # This is the top level of the density formula.
      return -1.0 * log10(numerator / sum_of_standard_wavelengths)
docs: Calculates density for the given SpectralColor using the spectral weighting
      function provided. For example, ANSI_STATUS_T_RED. These may be found in
      :py:mod:`colormath.density_standards`.
  
      :param SpectralColor color: The SpectralColor object to calculate
          density for.
      :param numpy.ndarray density_standard: NumPy array of filter of choice
          from :py:mod:`colormath.density_standards`.
      :rtype: float
      :returns: The density value for the given color and density standard.