Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create color command #222

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Create color command #222

wants to merge 3 commits into from

Conversation

Usoka
Copy link
Contributor

@Usoka Usoka commented May 25, 2021

New !!color command for utility plugin.
Usage: !!color <hex-code>
Alias: !!colour
Returns: A preview image (250x250, png) of the given colour.

backend/src/plugins/Utility/commands/ColorCmd.ts Outdated Show resolved Hide resolved
backend/src/plugins/Utility/commands/ColorCmd.ts Outdated Show resolved Hide resolved
@@ -1445,3 +1445,5 @@ export function unique<T>(arr: T[]): T[] {
}

export const DBDateFormat = "YYYY-MM-DD HH:mm:ss";

export const hexColorRegex = /^#?([a-fA-F0-9]{3}(?:[a-fA-F0-9]{3})?)$/;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
export const hexColorRegex = /^#?([a-fA-F0-9]{3}(?:[a-fA-F0-9]{3})?)$/;
export const hexColorRegex = /^#?((?:[a-f0-9]{3}){1,2})$/i;

import { hexColorRegex } from "src/utils";
import { sendErrorMessage } from "src/pluginUtils";
import { createCanvas } from "canvas";

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

Comment on lines +3 to +4
import { hexColorRegex } from "src/utils";
import { sendErrorMessage } from "src/pluginUtils";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consistency

Suggested change
import { hexColorRegex } from "src/utils";
import { sendErrorMessage } from "src/pluginUtils";
import { hexColorRegex } from "../../../utils";
import { sendErrorMessage } from "../../../pluginUtils";

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants