pygame documentation | || Home || Help Contents || || pygame || cdrom || constants || display || draw || event || || font || image || joystick || key || mixer || mixer_music || || mouse || movie || sndarray || surfarray || time || transform || || CD || Channel || Clock || Font || Joystick || Movie || || Rect || Sound || Surface || || color || cursors || sprite ||

## pygame.color

Manipulate colors

Color | - Get RGB values from common color names
add | - add two colors
multiply | - multiply two colors
subtract | - subtract two colors

Color
`pygame.color.Color(colorname) -> RGBA`

The color name can be the name of a common english color, or a "web" style color in the form of 0xFF00FF. The english color names are defined by the standard 'rgb' colors for X11. With the hex color formatting you may optionally include an alpha value, the formatting is 0xRRGGBBAA. You may also specify a hex formatted color by starting the string with a '#'. The color name used is case insensitive and whitespace is ignored.

add
`pygame.color.add(color1, color2) -> RGBA`

Add the RGB values of two colors together. If one of the colors is only a single numeric value, it is applied to the RGB components of the first color. Color values will be clamped to the maximum color value of 255.

multiply
`pygame.color.multiply(color1, color2) -> RGBA`

Multiply the RGB values of two colors together. If one of the colors is only a single numeric value, it is applied to the RGB components of the first color.

subtract
`pygame.color.subtract(color1, color2) -> RGBA`

Subtract the RGB values of two colors together. If one of the colors is only a single numeric value, it is applied to the RGB components of the first color. Color values will be clamped to the minimum color value of 0.