bauerj / paperless_app

An Android/iOS app for Paperless

Home Page:https://play.google.com/store/apps/details?id=eu.bauerj.paperless_app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Synchronize Tag Colors

BeneGrueter opened this issue · comments

Is your feature request related to a problem? Please describe.
Use tag colors from server in the app.

Describe the solution you'd like

  • I had to update to the API version 2 as described here
  • I added tag color and text_color data
  • Removed the OgTag class (don't know if it is still required)

Actually, in my opinion your approach for the text color of the tags (ThemeData.estimateBrightnessForColor(getColor()) == Brightness.light) seems to work a bit better than the code from Paperless-ngx, maybe you should omit changing getTextColor().

   Color getTextColor() {
-    if (ThemeData.estimateBrightnessForColor(getColor()) == Brightness.light)
-      return Colors.black;
-    return Colors.white;
+    return _fromHex(tag.textColor!);
   }