diff --git a/src-ui/src/app/components/common/input/color/color.component.html b/src-ui/src/app/components/common/input/color/color.component.html index d7b84566c..08cbf0bab 100644 --- a/src-ui/src/app/components/common/input/color/color.component.html +++ b/src-ui/src/app/components/common/input/color/color.component.html @@ -6,7 +6,7 @@
- +
diff --git a/src-ui/src/app/components/common/input/color/color.component.ts b/src-ui/src/app/components/common/input/color/color.component.ts index ebaa50327..a7f3452f2 100644 --- a/src-ui/src/app/components/common/input/color/color.component.ts +++ b/src-ui/src/app/components/common/input/color/color.component.ts @@ -1,7 +1,6 @@ -import { Component, Input, forwardRef } from '@angular/core'; +import { Component, forwardRef } from '@angular/core'; import { NG_VALUE_ACCESSOR } from '@angular/forms'; -import { ColorEvent, ColorMode } from 'ngx-color'; -import { randomColor, hslToHex } from 'src/app/utils/color'; +import { randomColor } from 'src/app/utils/color'; import { AbstractInputComponent } from '../abstract-input'; @Component({ @@ -16,26 +15,16 @@ import { AbstractInputComponent } from '../abstract-input'; }) export class ColorComponent extends AbstractInputComponent { - @Input() - colorMode: ColorMode = ColorMode.HEX - constructor() { super() } randomize() { - const color = randomColor(this.colorMode) - let colorHex = color - if (this.colorMode == ColorMode.HSL) { - const hsl = color.split(',') - colorHex = hslToHex(+hsl[0], +hsl[1], +hsl[2]) - } - this.value = colorHex - this.onChange(color) + this.colorChanged(randomColor()) } - sliderChanged(colorEvent:ColorEvent) { - this.value = colorEvent.color.hex - this.onChange(colorEvent.color[this.colorMode].toString()) + colorChanged(value) { + this.value = value + this.onChange(value) } } diff --git a/src-ui/src/app/components/manage/settings/settings.component.html b/src-ui/src/app/components/manage/settings/settings.component.html index ac37547a6..dac266277 100644 --- a/src-ui/src/app/components/manage/settings/settings.component.html +++ b/src-ui/src/app/components/manage/settings/settings.component.html @@ -105,7 +105,7 @@ Theme Color
- +