/* COPYRIGHT Esri - https://js.arcgis.com/5.0.18/LICENSE.txt */
import r from"../../Color.js";import{toPt as e}from"../../core/screenUtils.js";import{Integer as o}from"../../core/accessorSupport/ensureType.js";import{opacityToTransparency as t,transparencyToOpacity as n}from"../../webdoc/support/opacityUtils.js";function s(e,o){const t=null!=o.transparency?n(o.transparency):1,s=o.color;return s&&Array.isArray(s)?new r([s[0]||0,s[1]||0,s[2]||0,t]):null}function c(r,e){e.color=r.toJSON().slice(0,3);const o=t(r.a);0!==o&&(e.transparency=o)}function a(e){return{type:r,nonNullable:e?.nonNullable,json:{type:[o],default:null,read:{source:["color","transparency"],reader:s},write:{target:{color:{type:[o],isRequired:e?.colorRequiredOnWrite},transparency:{type:o}},writer:c}}}}const i={type:Number,cast:e,json:{write:!0}};function l(r){return"emissive"===r?0:1}export{a as colorAndTransparencyProperty,l as getEmissiveMode,i as screenSizeProperty};
