use of org.signal.imageeditor.core.ColorableRenderer in project Signal-Android by WhisperSystems.
the class ImageEditorFragment method changeEntityColor.
private void changeEntityColor(int selectedColor) {
if (currentSelection != null) {
Renderer renderer = currentSelection.getRenderer();
if (renderer instanceof ColorableRenderer) {
((ColorableRenderer) renderer).setColor(selectedColor);
onDrawingChanged(false, true);
}
}
}
use of org.signal.imageeditor.core.ColorableRenderer in project Signal-Android by WhisperSystems.
the class EditorModel method getUniqueColorsIgnoringAlpha.
public Set<Integer> getUniqueColorsIgnoringAlpha() {
final Set<Integer> colors = new LinkedHashSet<>();
editorElementHierarchy.getRoot().forAllInTree(element -> {
Renderer renderer = element.getRenderer();
if (renderer instanceof ColorableRenderer) {
colors.add(((ColorableRenderer) renderer).getColor() | 0xff000000);
}
});
return colors;
}
Aggregations