|
112 | 112 | The following is a list of all currently available flags, categorized into three sections:
|
113 | 113 |
|
114 | 114 | **Blending without Alpha Channel (RGB)**
|
115 |
| - ``BLEND_ADD`` / ``BLEND_RGB_ADD`` |
116 |
| - Adds the source color channels to the destination color channels, clamped to a maximum of 255. |
117 |
| - The result color is always a lighter color. |
118 | 115 |
|
119 |
| - -) Adding black to any color leaves the color unchanged. |
| 116 | + .. versionaddedold:: 1.8 / 1.8.1 |
120 | 117 |
|
121 |
| - -) Adding white to any color produces white. |
| 118 | + ``BLEND_ADD`` / ``BLEND_RGB_ADD`` |
| 119 | + Adds the source color channels to the destination color channels, clamped to a maximum of 255. |
| 120 | + The result color is always a lighter color. |
122 | 121 |
|
123 |
| - -) Adding any color to white produces white. |
| 122 | + -) Adding black to any color leaves the color unchanged. |
124 | 123 |
|
125 |
| - ``BLEND_SUB`` / ``BLEND_RGB_SUB`` |
126 |
| - Subtracts the source color channels from the destination color channels, clamped to a minimum of 0. |
127 |
| - The result color is always a darker color. |
| 124 | + -) Adding white to any color produces white. |
128 | 125 |
|
129 |
| - -) Subtracting any color from black produces black. |
| 126 | + -) Adding any color to white produces white. |
130 | 127 |
|
131 |
| - -) Subtracting white from any color produces black. |
| 128 | + ``BLEND_SUB`` / ``BLEND_RGB_SUB`` |
| 129 | + Subtracts the source color channels from the destination color channels, clamped to a minimum of 0. |
| 130 | + The result color is always a darker color. |
132 | 131 |
|
133 |
| - -) Subtracting black from any color leaves the color unchanged. |
| 132 | + -) Subtracting any color from black produces black. |
134 | 133 |
|
135 |
| - ``BLEND_MULT`` / ``BLEND_RGB_MULT`` |
136 |
| - Multiplies the destination color channels by the source color channels, divided by 256 (or >> 8). |
137 |
| - The result color is always a darker color. |
| 134 | + -) Subtracting white from any color produces black. |
138 | 135 |
|
139 |
| - -) Multiplying any color with black produces black. |
| 136 | + -) Subtracting black from any color leaves the color unchanged. |
140 | 137 |
|
141 |
| - -) Multiplying any color with white leaves the color unchanged. |
| 138 | + ``BLEND_MULT`` / ``BLEND_RGB_MULT`` |
| 139 | + Multiplies the destination color channels by the source color channels, divided by 256 (or >> 8). |
| 140 | + The result color is always a darker color. |
142 | 141 |
|
143 |
| - ``BLEND_MIN`` / ``BLEND_RGB_MIN`` |
144 |
| - Takes the minimum value between the source and destination color channels. |
| 142 | + -) Multiplying any color with black produces black. |
145 | 143 |
|
146 |
| - -) Minimizing any color with black produces black. |
| 144 | + -) Multiplying any color with white leaves the color unchanged. |
147 | 145 |
|
148 |
| - -) Minimizing any color with white leaves the color unchanged. |
| 146 | + ``BLEND_MIN`` / ``BLEND_RGB_MIN`` |
| 147 | + Takes the minimum value between the source and destination color channels. |
149 | 148 |
|
150 |
| - ``BLEND_MAX`` / ``BLEND_RGB_MAX`` |
151 |
| - Takes the maximum value of each color channel |
| 149 | + -) Minimizing any color with black produces black. |
152 | 150 |
|
153 |
| - -) Maximizing any color with black leaves the color unchanged. |
| 151 | + -) Minimizing any color with white leaves the color unchanged. |
154 | 152 |
|
155 |
| - -) Maximizing any color with white produces white. |
| 153 | + ``BLEND_MAX`` / ``BLEND_RGB_MAX`` |
| 154 | + Takes the maximum value of each color channel |
| 155 | + |
| 156 | + -) Maximizing any color with black leaves the color unchanged. |
| 157 | + |
| 158 | + -) Maximizing any color with white produces white. |
156 | 159 |
|
157 | 160 | **Blending with Alpha Channel (RGBA)**
|
158 |
| - ``BLEND_RGBA_ADD`` |
159 |
| - Works like ``BLEND_RGB_ADD``, but also adds the alpha channel. |
160 |
| - ``BLEND_RGBA_SUB`` |
161 |
| - Works like ``BLEND_RGB_SUB``, but also subtracts the alpha channel. |
162 |
| - ``BLEND_RGBA_MULT`` |
163 |
| - Works like ``BLEND_RGB_MULT``, but also multiplies the alpha channel. |
164 |
| - ``BLEND_RGBA_MIN`` |
165 |
| - Works like ``BLEND_RGB_MIN``, but also minimizes the alpha channel. |
166 |
| - ``BLEND_RGBA_MAX`` |
167 |
| - Works like ``BLEND_RGB_MAX``, but also maximizes the alpha channel. |
| 161 | + |
| 162 | + .. versionaddedold:: 1.8.1 |
| 163 | + |
| 164 | + ``BLEND_RGBA_ADD`` |
| 165 | + Works like ``BLEND_RGB_ADD``, but also adds the alpha channel. |
| 166 | + ``BLEND_RGBA_SUB`` |
| 167 | + Works like ``BLEND_RGB_SUB``, but also subtracts the alpha channel. |
| 168 | + ``BLEND_RGBA_MULT`` |
| 169 | + Works like ``BLEND_RGB_MULT``, but also multiplies the alpha channel. |
| 170 | + ``BLEND_RGBA_MIN`` |
| 171 | + Works like ``BLEND_RGB_MIN``, but also minimizes the alpha channel. |
| 172 | + ``BLEND_RGBA_MAX`` |
| 173 | + Works like ``BLEND_RGB_MAX``, but also maximizes the alpha channel. |
168 | 174 |
|
169 | 175 | **Special Alpha Blending (RGBA)**
|
170 |
| - ``BLEND_PREMULTIPLIED`` |
171 |
| - Uses premultiplied alpha blending for faster and accurate results when |
172 |
| - the color channels are already multiplied by the image alpha channel. |
173 |
| - You should only use this blend mode if you previously premultiplied the source |
174 |
| - surface with :meth:`premul_alpha()`. |
175 |
| - ``BLEND_ALPHA_SDL2`` |
176 |
| - Uses the SDL2 blitter for alpha blending, which may give slightly different |
177 |
| - results compared to the default blitter used in Pygame 1. This algorithm uses |
178 |
| - different approximations for alpha blending and supports Run-Length Encoding |
179 |
| - (RLE) on alpha-blended surfaces. |
| 176 | + |
| 177 | + .. versionaddedold:: 1.9.2 |
| 178 | + |
| 179 | + ``BLEND_PREMULTIPLIED`` |
| 180 | + Uses premultiplied alpha blending for faster and accurate results when |
| 181 | + the color channels are already multiplied by the image alpha channel. |
| 182 | + You should only use this blend mode if you previously premultiplied the source |
| 183 | + surface with :meth:`premul_alpha()`. |
| 184 | + |
| 185 | + .. versionaddedold:: 2.0.0 |
| 186 | + |
| 187 | + ``BLEND_ALPHA_SDL2`` |
| 188 | + Uses the SDL2 blitter for alpha blending, which may give slightly different |
| 189 | + results compared to the default blitter used in Pygame 1. This algorithm uses |
| 190 | + different approximations for alpha blending and supports Run-Length Encoding |
| 191 | + (RLE) on alpha-blended surfaces. |
180 | 192 |
|
181 | 193 | .. method:: blit
|
182 | 194 |
|
|
0 commit comments