mirror of
https://github.com/wbbaddons/Tims-Chat.git
synced 2024-12-21 21:30:08 +00:00
Remove the leading #
in the color command
Starting with PHP 7.4 passing invalid characters to `hexdec` generates a deprecation notice.
This commit is contained in:
parent
ae637128c3
commit
4544813255
@ -18,7 +18,10 @@ define(['../Command', '../Parser'], function (Command, Parser) {
|
|||||||
getParameterParser() {
|
getParameterParser() {
|
||||||
// Either match a color in hexadecimal RGB notation or a color name (just letters)
|
// Either match a color in hexadecimal RGB notation or a color name (just letters)
|
||||||
const color = Parser.F.try(
|
const color = Parser.F.try(
|
||||||
Parser.RGBHex.map((color) => ({ type: 'hex', value: color }))
|
Parser.RGBHex.map((color) => ({
|
||||||
|
type: 'hex',
|
||||||
|
value: color.replace(/^#/, ''),
|
||||||
|
}))
|
||||||
).or(new Parser.X().word().map((word) => ({ type: 'word', value: word })))
|
).or(new Parser.X().word().map((word) => ({ type: 'word', value: word })))
|
||||||
|
|
||||||
// Either match a single color or two colors separated by a space
|
// Either match a single color or two colors separated by a space
|
||||||
|
Loading…
Reference in New Issue
Block a user