Add automatic coloring of tags

Please see this as proposal on how to implement automatic/random colors
for tags while keeping the current set of hard coded colors in place (at
least in the frontend).

Bear with me as I have even less Angular knowledge than Django and just
tried to get away with as few changes as possible. :-) AIUI you want to
change to a color picking system anyways in the future, which could also
play well with this.

fixes #51
This commit is contained in:
jayme-github
2020-12-03 20:12:55 +01:00
parent 555a1a6b64
commit 98787f5f4d
10 changed files with 116 additions and 42 deletions

View File

@@ -3,26 +3,27 @@ import { ObjectWithId } from './object-with-id';
export const TAG_COLOURS = [
{id: 1, value: "#a6cee3", name: "Light Blue", textColor: "#000000"},
{id: 2, value: "#1f78b4", name: "Blue", textColor: "#ffffff"},
{id: 3, value: "#b2df8a", name: "Light Green", textColor: "#000000"},
{id: 4, value: "#33a02c", name: "Green", textColor: "#000000"},
{id: 5, value: "#fb9a99", name: "Light Red", textColor: "#000000"},
{id: 6, value: "#e31a1c", name: "Red ", textColor: "#ffffff"},
{id: 7, value: "#fdbf6f", name: "Light Orange", textColor: "#000000"},
{id: 8, value: "#ff7f00", name: "Orange", textColor: "#000000"},
{id: 9, value: "#cab2d6", name: "Light Violet", textColor: "#000000"},
{id: 10, value: "#6a3d9a", name: "Violet", textColor: "#ffffff"},
{id: 11, value: "#b15928", name: "Brown", textColor: "#000000"},
{id: 12, value: "#000000", name: "Black", textColor: "#ffffff"},
{id: 13, value: "#cccccc", name: "Light Grey", textColor: "#000000"}
{ id: "", name: "Auto", textColor: "#000000" },
{ id: "#a6cee3", name: "Light Blue", textColor: "#000000" },
{ id: "#1f78b4", name: "Blue", textColor: "#ffffff" },
{ id: "#b2df8a", name: "Light Green", textColor: "#000000" },
{ id: "#33a02c", name: "Green", textColor: "#000000" },
{ id: "#fb9a99", name: "Light Red", textColor: "#000000" },
{ id: "#e31a1c", name: "Red ", textColor: "#ffffff" },
{ id: "#fdbf6f", name: "Light Orange", textColor: "#000000" },
{ id: "#ff7f00", name: "Orange", textColor: "#000000" },
{ id: "#cab2d6", name: "Light Violet", textColor: "#000000" },
{ id: "#6a3d9a", name: "Violet", textColor: "#ffffff" },
{ id: "#b15928", name: "Brown", textColor: "#000000" },
{ id: "#000000", name: "Black", textColor: "#ffffff" },
{ id: "#cccccc", name: "Light Grey", textColor: "#000000" }
]
export interface PaperlessTag extends MatchingModel {
colour?: number
colour?: string
is_inbox_tag?: boolean
document_count?: number
}