refactor: credential table columns
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import _ from 'lodash';
|
||||
import tinycolor from 'tinycolor2';
|
||||
|
||||
export const isNotEmptyValue = (value: any) => {
|
||||
if (Array.isArray(value)) {
|
||||
@@ -219,3 +220,22 @@ export const base64ToFile = (base64String: string, fileName: string) => {
|
||||
export const isOnline = () => {
|
||||
return window.navigator.onLine;
|
||||
};
|
||||
|
||||
export const genColors = ({
|
||||
color,
|
||||
alpha1,
|
||||
alpha2
|
||||
}: {
|
||||
color: string;
|
||||
alpha1?: number;
|
||||
alpha2?: number;
|
||||
}) => {
|
||||
const base = tinycolor(color);
|
||||
const alpha_start = alpha1 || base.getAlpha();
|
||||
const alpha_end = alpha2 || base.getAlpha();
|
||||
|
||||
return [
|
||||
base.setAlpha(alpha_start).toRgbString(),
|
||||
base.setAlpha(alpha_end).toRgbString()
|
||||
];
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user