File tree Expand file tree Collapse file tree 1 file changed +0
-22
lines changed
Expand file tree Collapse file tree 1 file changed +0
-22
lines changed Original file line number Diff line number Diff line change @@ -316,28 +316,6 @@ class Color {
316316 return color_with_alpha;
317317 }
318318
319- constexpr Color to_premultiplied () const
320- {
321- u32 a = alpha ();
322- u8 r = static_cast <u8 >((red () * a + 127 ) / 255 );
323- u8 g = static_cast <u8 >((green () * a + 127 ) / 255 );
324- u8 b = static_cast <u8 >((blue () * a + 127 ) / 255 );
325- return Color (r, g, b, a);
326- }
327-
328- constexpr Color to_unpremultiplied () const
329- {
330- u32 a = alpha ();
331- if (a == 0 )
332- return Color (0 , 0 , 0 , 0 );
333- if (a == 255 )
334- return *this ;
335- u8 r = static_cast <u8 >(min (255u , (red () * 255u + a / 2 ) / a));
336- u8 g = static_cast <u8 >(min (255u , (green () * 255u + a / 2 ) / a));
337- u8 b = static_cast <u8 >(min (255u , (blue () * 255u + a / 2 ) / a));
338- return Color (r, g, b, a);
339- }
340-
341319 constexpr Color blend (Color source) const
342320 {
343321 if (alpha () == 0 || source.alpha () == 255 )
You can’t perform that action at this time.
0 commit comments