Extract disabled opacity const
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
export const API_ROOT = "/re-customutils";
|
||||
export const EMPTY_VALUE = "--";
|
||||
|
||||
export const DISABLED_OPACITY = 0.4;
|
||||
|
||||
export const COLORS = {
|
||||
text: "#e0e0e0",
|
||||
inactive: "#888888",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { COLORS } from "../constants.js";
|
||||
import { COLORS, DISABLED_OPACITY } from "../constants.js";
|
||||
import { fitString, hideWidget, hideWidgetInput } from "../utils.js";
|
||||
import { app } from "/scripts/app.js";
|
||||
|
||||
@@ -42,7 +42,7 @@ export class InlineTextToggleWidget {
|
||||
const isDisabled = this.disabled;
|
||||
|
||||
ctx.save();
|
||||
if (isDisabled) ctx.globalAlpha = 0.4;
|
||||
if (isDisabled) ctx.globalAlpha = DISABLED_OPACITY;
|
||||
|
||||
ctx.font = "11px monospace";
|
||||
ctx.textBaseline = "middle";
|
||||
|
||||
Reference in New Issue
Block a user