diff options
| author | geireann <geireann.lindfield@gmail.com> | 2021-08-24 19:07:24 -0400 |
|---|---|---|
| committer | geireann <geireann.lindfield@gmail.com> | 2021-08-24 19:07:24 -0400 |
| commit | 5e12fe1f5dfe73aeb5744d61ecbee02fbf14c59e (patch) | |
| tree | f6e40215834974d3692bce12af09f7f461deb860 /src/Utils.ts | |
| parent | 0c5a95f37e91a07041699514155fd214f544a0de (diff) | |
| parent | e221001a24e8615aa6113dd3f25b8c6e10c74999 (diff) | |
Merge branch 'master' into menu_updates_geireann
Diffstat (limited to 'src/Utils.ts')
| -rw-r--r-- | src/Utils.ts | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/Utils.ts b/src/Utils.ts index 0887759ee..d653acd34 100644 --- a/src/Utils.ts +++ b/src/Utils.ts @@ -117,6 +117,16 @@ export namespace Utils { return { r: r, g: g, b: b, a: a }; } + export function IsTransparentFilter() { + // bcz: isTransparent(__value__) is a hack. it would be nice to have acual functions be parsed, but now Doc.matchFieldValue is hardwired to recognize just this one + return ["backgroundColor:isTransparent(__value__):check"]; + } + export function IsOpaqueFilter() { + // bcz: isTransparent(__value__) is a hack. it would be nice to have acual functions be parsed, but now Doc.matchFieldValue is hardwired to recognize just this one + return ["backgroundColor:isTransparent(__value__):x"]; + } + + export function toRGBAstr(col: { r: number, g: number, b: number, a?: number }) { return "rgba(" + col.r + "," + col.g + "," + col.b + (col.a !== undefined ? "," + col.a : "") + ")"; } @@ -392,8 +402,7 @@ export function formatTime(time: number) { const hours = Math.floor(time / 60 / 60); const minutes = Math.floor(time / 60) - (hours * 60); const seconds = time % 60; - - return hours.toString().padStart(2, '0') + ':' + minutes.toString().padStart(2, '0') + ':' + seconds.toString().padStart(2, '0'); + return (hours ? hours.toString() + ":" : "") + minutes.toString().padStart(2, '0') + ':' + seconds.toString().padStart(2, '0'); } export function aggregateBounds(boundsList: { x: number, y: number, width?: number, height?: number }[], xpad: number, ypad: number) { |
