{
  "version": 3,
  "sources": ["../../src/misc/TLOpacity.ts"],
  "sourcesContent": ["import { T } from '@tldraw/validate'\n\n/**\n * A type representing opacity values in tldraw.\n *\n * Opacity values are numbers between 0 and 1, where 0 is fully transparent\n * and 1 is fully opaque. This type is used throughout the editor to control\n * the transparency of shapes, UI elements, and other visual components.\n *\n * @example\n * ```ts\n * const fullyOpaque: TLOpacityType = 1.0\n * const halfTransparent: TLOpacityType = 0.5\n * const fullyTransparent: TLOpacityType = 0.0\n * const quarterOpaque: TLOpacityType = 0.25\n * ```\n *\n * @public\n */\nexport type TLOpacityType = number\n\n/**\n * A validator for opacity values.\n *\n * This validator ensures that opacity values are numbers between 0 and 1 (inclusive).\n * Values outside this range will cause a validation error. The validator provides\n * runtime type checking for opacity properties throughout the editor.\n *\n * @param n - The number to validate as an opacity value\n * @throws T.ValidationError When the value is not between 0 and 1\n *\n * @example\n * ```ts\n * import { opacityValidator } from '@tldraw/tlschema'\n *\n * // Valid opacity values\n * try {\n *   const validOpacity1 = opacityValidator.validate(0.5) // \u2713\n *   const validOpacity2 = opacityValidator.validate(1.0) // \u2713\n *   const validOpacity3 = opacityValidator.validate(0.0) // \u2713\n * } catch (error) {\n *   console.error('Validation failed:', error.message)\n * }\n *\n * // Invalid opacity values\n * try {\n *   opacityValidator.validate(-0.1) // \u2717 Throws error\n *   opacityValidator.validate(1.5)  // \u2717 Throws error\n * } catch (error) {\n *   console.error('Invalid opacity:', error.message)\n * }\n * ```\n *\n * @public\n */\nexport const opacityValidator = T.unitInterval\n"],
  "mappings": "AAAA,SAAS,SAAS;AAuDX,MAAM,mBAAmB,EAAE;",
  "names": []
}
