{"version":3,"file":"colorPair.js","sources":["../../../../Framework/Core/Utilities/colorPair.ts"],"sourcesContent":["// \r\n// Copyright by the Spark Development Network\r\n//\r\n// Licensed under the Rock Community License (the \"License\");\r\n// you may not use this file except in compliance with the License.\r\n// You may obtain a copy of the License at\r\n//\r\n// http://www.rockrms.com/license\r\n//\r\n// Unless required by applicable law or agreed to in writing, software\r\n// distributed under the License is distributed on an \"AS IS\" BASIS,\r\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n// See the License for the specific language governing permissions and\r\n// limitations under the License.\r\n// \r\n//\r\n\r\nimport { RockColor } from \"./rockColor\";\r\n\r\n/**\r\n * Pair of colors representing the foreground and background colors.\r\n */\r\nexport class ColorPair {\r\n /** The foreground color. */\r\n public foregroundColor: RockColor;\r\n\r\n /** The background color. */\r\n public backgroundColor: RockColor;\r\n\r\n /**\r\n * The contrast ratio between the foreground and background colors.\r\n */\r\n public get contrastRatio(): number {\r\n return RockColor.calculateContrastRatio(this.foregroundColor, this.backgroundColor);\r\n }\r\n\r\n /**\r\n * Creates a new pair of colors from the given colors.\r\n *\r\n * @param foregroundColor The foreground color.\r\n * @param backgroundColor The background color.\r\n */\r\n constructor(foregroundColor: RockColor, backgroundColor: RockColor) {\r\n this.foregroundColor = foregroundColor;\r\n this.backgroundColor = backgroundColor;\r\n }\r\n\r\n /**\r\n * Flips the foreground and background colors.\r\n */\r\n public flip(): void {\r\n const tempColor = this.foregroundColor;\r\n\r\n this.foregroundColor = this.backgroundColor;\r\n this.backgroundColor = tempColor;\r\n }\r\n}\r\n"],"names":["ColorPair","contrastRatio","RockColor","calculateContrastRatio","foregroundColor","backgroundColor","constructor","flip","tempColor"],"mappings":";;;;;;;;;YAsBO,MAAMA,SAAS,CAAC;cAUnB,IAAWC,aAAaA,GAAW;gBAC/B,OAAOC,SAAS,CAACC,sBAAsB,CAAC,IAAI,CAACC,eAAe,EAAE,IAAI,CAACC,eAAe,CAAC,CAAA;YACvF,GAAA;YAQAC,EAAAA,WAAWA,CAACF,eAA0B,EAAEC,eAA0B,EAAE;gBAChE,IAAI,CAACD,eAAe,GAAGA,eAAe,CAAA;gBACtC,IAAI,CAACC,eAAe,GAAGA,eAAe,CAAA;YAC1C,GAAA;YAKOE,EAAAA,IAAIA,GAAS;YAChB,IAAA,IAAMC,SAAS,GAAG,IAAI,CAACJ,eAAe,CAAA;YAEtC,IAAA,IAAI,CAACA,eAAe,GAAG,IAAI,CAACC,eAAe,CAAA;gBAC3C,IAAI,CAACA,eAAe,GAAGG,SAAS,CAAA;YACpC,GAAA;YACJ;;;;;;;;"}