Skip to content
Snippets Groups Projects
Commit ba7476a3 authored by Jose Manuel Serrano Amaut's avatar Jose Manuel Serrano Amaut
Browse files

[FEAT]: Add completesureColor and default color for font

parent 8e566dce
No related branches found
No related tags found
No related merge requests found
......@@ -210,7 +210,22 @@ export const hexTodec = (letter: string): number => {
if (color !== undefined && color !== "") {
return color;
} else {
return "#646c7f";
return DEFAULT_FONT_COLOR;
}
}
/**
* Asure a base color. When not given or when given an incorrect color format
* default color is this kind of grey #5d6475
*
* @param color param color given by user
* @returns returns the same color
*/
export const completeAsureColor = (color?: string, perc = 1): string => {
return hexColorToRGB(asureColor(colourNameToHex(color)), perc);
}
export const DEFAULT_FONT_COLOR = "#646c7f";
\ No newline at end of file
......@@ -6,5 +6,6 @@ export {
darkerColor,
hexColorToRGB,
hexTodec,
isHexColor
isHexColor,
completeAsureColor
} from "./colors";
\ No newline at end of file
......@@ -163,7 +163,8 @@ export {
hexColorToRGB,
hexTodec,
isHexColor,
NAMED_COLORS
NAMED_COLORS,
completeAsureColor
} from "./color";
export {
......
import { asureColor, colourNameToHex, hexColorToRGB } from "../color";
import { completeAsureColor, hexColorToRGB } from "../color";
const asureRippleColor = (color: string): string => {
return hexColorToRGB(
asureColor(colourNameToHex(color)),
return completeAsureColor(color,
0.4
);
}
......@@ -69,10 +68,7 @@ export function createRippleButton<
circle.classList.add("ripple");
if (variant !== "contained") {
circle.style.backgroundColor = hexColorToRGB(
asureColor(colourNameToHex(color)),
0.4
);
circle.style.backgroundColor = asureRippleColor(color);
} else {
circle.style.backgroundColor = hexColorToRGB("#ffffff", 0.4);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment