Reserves a color in the output palette created from this image. It behaves as if the given color was used in the image and was very important. The RGB values are assumed to have the same gamma as the image. It must be called before the image is quantized. Returns error if more than 256 colors are added. If image is quantized to fewer colors than the number of fixed colors added, then excess fix
(&mut self, color: RGBA)
| 207 | /// |
| 208 | /// Returns error if more than 256 colors are added. If image is quantized to fewer colors than the number of fixed colors added, then excess fixed colors will be ignored. |
| 209 | pub fn add_fixed_color(&mut self, color: RGBA) -> Result<(), Error> { |
| 210 | if self.fixed_colors.len() >= MAX_COLORS { return Err(Unsupported); } |
| 211 | self.fixed_colors.try_reserve(1)?; |
| 212 | self.fixed_colors.push_in_cap(color); |
| 213 | Ok(()) |
| 214 | } |
| 215 | |
| 216 | /// Width of the image in pixels |
| 217 | #[must_use] |
nothing calls this directly
no test coverage detected