mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-16 22:18:30 +00:00
Fix color_utils::color_for_image() when the color is of index type and the imgtype is indexed.
This commit is contained in:
parent
ae918802e3
commit
75fd21164e
@ -123,6 +123,9 @@ int color_utils::color_for_image(const Color& color, int imgtype)
|
|||||||
c = _graya(color.getGray(), 255);
|
c = _graya(color.getGray(), 255);
|
||||||
break;
|
break;
|
||||||
case IMAGE_INDEXED:
|
case IMAGE_INDEXED:
|
||||||
|
if (color.getType() == Color::IndexType)
|
||||||
|
c = color.getIndex();
|
||||||
|
else
|
||||||
c = get_current_palette()->findBestfit(color.getRed(), color.getGreen(), color.getBlue());
|
c = get_current_palette()->findBestfit(color.getRed(), color.getGreen(), color.getBlue());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user