oh-colorpicker: Replace defaultColor option with an actual default color (#2270)
Remove the defaultColor option. Instead use RGB(0,0,0) black as default color if the Item state holds no valid color, so that the color picker is accessible. --------- Signed-off-by: Florian Hotze <florianh_dev@icloud.com>pull/2263/head^2
parent
4d4aea4a69
commit
f912de509c
|
@ -83,11 +83,6 @@ Display a color picker in a card
|
|||
<PropOption value="initial-current-colors" label="Initial current colors" />
|
||||
</PropOptions>
|
||||
</PropBlock>
|
||||
<PropBlock type="TEXT" name="defaultColor" label="Default Color">
|
||||
<PropDescription>
|
||||
Color (e.g. <code>[0,0,0]</code> for black) to use for the color picker if state does not contain a color (e.g. because it is <code>NULL</code>)
|
||||
</PropDescription>
|
||||
</PropBlock>
|
||||
</PropGroup>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -93,11 +93,6 @@ A cell expanding to a color picker
|
|||
<PropOption value="initial-current-colors" label="Initial current colors" />
|
||||
</PropOptions>
|
||||
</PropBlock>
|
||||
<PropBlock type="TEXT" name="defaultColor" label="Default Color">
|
||||
<PropDescription>
|
||||
Color (e.g. <code>[0,0,0]</code> for black) to use for the color picker if state does not contain a color (e.g. because it is <code>NULL</code>)
|
||||
</PropDescription>
|
||||
</PropBlock>
|
||||
</PropGroup>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -88,11 +88,6 @@ Display a color picker in a list
|
|||
<PropOption value="initial-current-colors" label="Initial current colors" />
|
||||
</PropOptions>
|
||||
</PropBlock>
|
||||
<PropBlock type="TEXT" name="defaultColor" label="Default Color">
|
||||
<PropDescription>
|
||||
Color (e.g. <code>[0,0,0]</code> for black) to use for the color picker if state does not contain a color (e.g. because it is <code>NULL</code>)
|
||||
</PropDescription>
|
||||
</PropBlock>
|
||||
</PropGroup>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -51,11 +51,6 @@ Control to pick a color
|
|||
<PropOption value="initial-current-colors" label="Initial current colors" />
|
||||
</PropOptions>
|
||||
</PropBlock>
|
||||
<PropBlock type="TEXT" name="defaultColor" label="Default Color">
|
||||
<PropDescription>
|
||||
Color (e.g. <code>[0,0,0]</code> for black) to use for the color picker if state does not contain a color (e.g. because it is <code>NULL</code>)
|
||||
</PropDescription>
|
||||
</PropBlock>
|
||||
</PropGroup>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -14,6 +14,5 @@ export default () => [
|
|||
{ value: 'palette', label: 'Palette' },
|
||||
{ value: 'current-color', label: 'Current color' },
|
||||
{ value: 'initial-current-colors', label: 'Initial current colors' }
|
||||
], true, true),
|
||||
pt('defaultColor', 'Default Color', 'Color (e.g. <code>[0,0,0]</code> for black) to use for the color picker if state does not contain a color (e.g. because it is <code>NULL</code>)')
|
||||
], true, true)
|
||||
]
|
||||
|
|
|
@ -51,14 +51,7 @@ export default {
|
|||
color[2] = color[2] / 100
|
||||
return color
|
||||
}
|
||||
if (this.config.defaultColor) {
|
||||
try {
|
||||
return JSON.parse(this.config.defaultColor)
|
||||
} catch {
|
||||
return null
|
||||
}
|
||||
}
|
||||
return null
|
||||
return [0, 0, 0]
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
|
Loading…
Reference in New Issue