mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
hide fill icons when fill color transparent (#2414)
Co-authored-by: Panayiotis Lipiridis <lipiridis@gmail.com>
This commit is contained in:
parent
6c0296c434
commit
ca60244aa3
5 changed files with 289 additions and 16 deletions
13
src/utils.ts
13
src/utils.ts
|
@ -1,10 +1,11 @@
|
|||
import { Zoom } from "./types";
|
||||
import colors from "./colors";
|
||||
import {
|
||||
CURSOR_TYPE,
|
||||
FONT_FAMILY,
|
||||
WINDOWS_EMOJI_FALLBACK_FONT,
|
||||
} from "./constants";
|
||||
import { FontFamily, FontString } from "./element/types";
|
||||
import { Zoom } from "./types";
|
||||
|
||||
export const SVG_NS = "http://www.w3.org/2000/svg";
|
||||
|
||||
|
@ -292,3 +293,13 @@ export const findLastIndex = <T>(
|
|||
}
|
||||
return -1;
|
||||
};
|
||||
|
||||
export const isTransparent = (color: string) => {
|
||||
const isRGBTransparent = color.length === 5 && color.substr(4, 1) === "0";
|
||||
const isRRGGBBTransparent = color.length === 9 && color.substr(7, 2) === "00";
|
||||
return (
|
||||
isRGBTransparent ||
|
||||
isRRGGBBTransparent ||
|
||||
color === colors.elementBackground[0]
|
||||
);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue