How to use baseColor method in argos

Best JavaScript code snippet using argos

Color.js

Source:Color.js Github

copy

Full Screen

1/*2* Licensed Materials - Property of IBM Corp.3* IBM UrbanCode Deploy4* (c) Copyright IBM Corporation 2011, 2014. All Rights Reserved.5*6* U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by7* GSA ADP Schedule Contract with IBM Corp.8*/9/*global i18n, define */10define(["dojo/_base/array",11 "dojo/_base/lang"12 ],13function(array,14 lang) {15 /**16 * Defines the color palette from the IBM Design Language. Includes definitions of the dojo17 * color palette to convert those colors to a color closest to a color in the IBM Design language.18 */19 return {20 /**21 * Set of colors from the IBM Design Language.22 */23 colors: {24 "#F04E37" : {25 name: i18n("Vermillion"),26 simpleName: i18n("Light Red"),27 baseColor: i18n("Red"),28 value: "#F04E37",29 fallback: "#D9182D",30 full: true31 },32 "#D9182D" : {33 name: i18n("Crimson"),34 simpleName: i18n("Red"),35 baseColor: i18n("Red"),36 value: "#D9182D",37 simple: true,38 basic: true,39 standard: true,40 full: true41 },42 "#A91024" : {43 name: i18n("Firebrick"),44 simpleName: i18n("Dark Red"),45 baseColor: i18n("Red"),46 value: "#A91024",47 fallback: "#D9182D",48 basic: true,49 standard: true,50 full: true51 },52 "#F19027" : {53 name: i18n("Carrot Orange"),54 simpleName: i18n("Light Orange"),55 baseColor: i18n("Orange"),56 value: "#F19027",57 fallback: "#DD731C",58 full: true59 },60 "#DD731C" : {61 name: i18n("Cinnamon"),62 simpleName: i18n("Orange"),63 baseColor: i18n("Orange"),64 value: "#DD731C",65 simple: true,66 basic: true,67 standard: true,68 full: true69 },70 "#B8461B" : {71 name: i18n("Rust"),72 simpleName: i18n("Dark Orange"),73 baseColor: i18n("Orange"),74 value: "#B8461B",75 fallback: "#DD731C",76 basic: true,77 standard: true,78 full: true79 },80 "#FFE14F" : {81 name: i18n("Mustard"),82 simpleName: i18n("Light Yellow"),83 baseColor: i18n("Yellow"),84 value: "#FFE14F",85 fallback: "#FFCF01",86 light: true,87 full: true88 },89 "#FFCF01" : {90 name: i18n("Tangerine Yellow"),91 simpleName: i18n("Yellow"),92 baseColor: i18n("Yellow"),93 value: "#FFCF01",94 light: true,95 simple: true,96 basic: true,97 standard: true,98 full: true99 },100 "#FDB813" : {101 name: i18n("Golden Poppy"),102 simpleName: i18n("Dark Yellow"),103 baseColor: i18n("Yellow"),104 value: "#FDB813",105 fallback: "#FFCF01",106 light: true,107 basic: true,108 standard: true,109 full: true110 },111 "#8CC63F" : {112 name: i18n("Yellow Green"),113 simpleName: i18n("Light Green"),114 baseColor: i18n("Green"),115 value: "#8CC63F",116 fallback: "#17AF4B",117 full: true118 },119 "#17AF4B" : {120 name: i18n("Mountain Meadow"),121 simpleName: i18n("Green"),122 baseColor: i18n("Green"),123 value: "#17AF4B",124 simple: true,125 basic: true,126 standard: true,127 full: true128 },129 "#008A52" : {130 name: i18n("Sea Green"),131 simpleName: i18n("Dark Green"),132 baseColor: i18n("Green"),133 value: "#008A52",134 fallback: "#17AF4B",135 basic: true,136 standard: true,137 full: true138 },139 "#00A6A0" : {140 name: i18n("Persian Green"),141 simpleName: i18n("Light Teal"),142 baseColor: i18n("Green"),143 value: "#00A6A0",144 fallback: "#007670",145 basicFallback: "#17AF4B",146 full: true147 },148 "#007670" : {149 name: i18n("Pine Green"),150 simpleName: i18n("Teal"),151 baseColor: i18n("Green"),152 value: "#007670",153 fallback: "#17AF4B",154 standard: true,155 full: true156 },157 "#006059" : {158 name: i18n("Bottle Green"),159 simpleName: i18n("Dark Teal"),160 baseColor: i18n("Green"),161 value: "#006059",162 fallback: "#007670",163 basicFallback: "#17AF4B",164 standard: true,165 full: true166 },167 "#82D1F5" : {168 name: i18n("Baby Blue"),169 simpleName: i18n("Light Blue"),170 baseColor: i18n("Blue"),171 value: "#82D1F5",172 fallback: "#00B2EF",173 light: true,174 full: true175 },176 "#00B2EF" : {177 name: i18n("Bright Cerulean"),178 simpleName: i18n("Blue"),179 baseColor: i18n("Blue"),180 value: "#00B2EF",181 simple: true,182 basic: true,183 standard: true,184 full: true185 },186 "#00648D" : {187 name: i18n("Sea Blue"),188 simpleName: i18n("Dark Blue"),189 baseColor: i18n("Blue"),190 value: "#00648D",191 fallback: "#00B2EF",192 basic: true,193 standard: true,194 full: true195 },196 "#00B0DA" : {197 name: i18n("Iris Blue"),198 simpleName: i18n("Light Blue 2"),199 baseColor: i18n("Blue"),200 value: "#00B0DA",201 fallback: "#00B2EF",202 basicFallback: "#00B2EF",203 full: true204 },205 "#008ABF" : {206 name: i18n("Bondi Blue"),207 simpleName: i18n("Blue 2"),208 baseColor: i18n("Blue"),209 value: "#008ABF",210 fallback: "#00B2EF",211 standard: true,212 full: true213 },214 "#003F69" : {215 name: i18n("Prussian Blue"),216 simpleName: i18n("Dark Blue 2"),217 baseColor: i18n("Blue"),218 value: "#003F69",219 fallback: "#00648D",220 basicFallback: "#00648D",221 standard: true,222 full: true223 },224 "#AB1A86" : {225 name: i18n("Red Violet"),226 simpleName: i18n("Light Purple"),227 baseColor: i18n("Purple"),228 value: "#AB1A86",229 fallback: "#7F1C7D",230 basic: true,231 standard: true,232 full: true233 },234 "#7F1C7D" : {235 name: i18n("Mardi Gras"),236 simpleName: i18n("Purple"),237 baseColor: i18n("Purple"),238 value: "#7F1C7D",239 simple: true,240 basic: true,241 standard: true,242 full: true243 },244 "#3B0256" : {245 name: i18n("Indigo"),246 simpleName: i18n("Dark Purple"),247 baseColor: i18n("Purple"),248 value: "#3B0256",249 fallback: "#7F1C7D",250 full: true251 },252 "#F389AF" : {253 name: i18n("Mauvelous"),254 simpleName: i18n("Light Pink"),255 baseColor: i18n("Pink"),256 value: "#F389AF",257 fallback: "#EE3D96",258 basic: true,259 standard: true,260 full: true261 },262 "#EE3D96" : {263 name: i18n("French Rose"),264 simpleName: i18n("Pink"),265 baseColor: i18n("Pink"),266 value: "#EE3D96",267 simple: true,268 basic: true,269 standard: true,270 full: true271 },272 "#BA006E" : {273 name: i18n("Jazzberry Jam"),274 simpleName: i18n("Dark Pink"),275 baseColor: i18n("Pink"),276 value: "#BA006E",277 fallback: "#EE3D96",278 full: true279 },280 "#A5A215" : {281 name: i18n("Brass"),282 simpleName: i18n("Light Taupe"),283 baseColor: i18n("Yellow"),284 value: "#A5A215",285 fallback: "#838329",286 basicFallback: "#FFCF01",287 full: true288 },289 "#838329" : {290 name: i18n("Olive"),291 simpleName: i18n("Taupe"),292 baseColor: i18n("Yellow"),293 value: "#838329",294 fallback: "#FDB813",295 basicFallback: "#FFCF01",296 standard: true,297 full: true298 },299 "#594F13" : {300 name: i18n("Antique Bronze"),301 simpleName: i18n("Dark Taupe"),302 baseColor: i18n("Yellow"),303 value: "#594F13",304 fallback: "#838329",305 basicFallback: "#FDB813",306 standard: true,307 full: true308 },309 "#929497" : {310 name: i18n("Aluminum"),311 simpleName: i18n("Light Gray"),312 baseColor: i18n("Black"),313 value: "#929497",314 fallback: "#6D6E70",315 full: true316 },317 "#6D6E70" : {318 name: i18n("Dim Gray"),319 simpleName: i18n("Gray"),320 baseColor: i18n("Black"),321 value: "#6D6E70",322 simple: true,323 basic: true,324 standard: true,325 full: true326 },327 "#404041" : {328 name: i18n("Jet"),329 simpleName: i18n("Dark Gray"),330 baseColor: i18n("Black"),331 value: "#404041",332 fallback: "#6D6E70",333 basic: true,334 standard: true,335 full: true336 },337 "#A8A7A5" : {338 name: i18n("Silver Chalice"),339 simpleName: i18n("Light Gray 2"),340 baseColor: i18n("Black"),341 value: "#A8A7A5",342 fallback: "#83827F",343 basicFallback: "#6D6E70",344 full: true345 },346 "#83827F" : {347 name: i18n("Battleship Grey"),348 simpleName: i18n("Gray 2"),349 baseColor: i18n("Black"),350 value: "#83827F",351 standard: true,352 fallback: "#6D6E70",353 full: true354 },355 "#605F5C" : {356 name: i18n("Sonic Silver"),357 simpleName: i18n("Dark Gray 2"),358 baseColor: i18n("Black"),359 value: "#605F5C",360 fallback: "#83827F",361 basicFallback: "#404041",362 standard: true,363 full: true364 }365 },366 /**367 * Return a list of colors from the IBM Design Language.368 */369 getColors: function() {370 var self = this;371 var colors = [];372 // Array retrieves color objects in this order.373 var colorList = [374 // Red375 "#F04E37",376 "#D9182D",377 "#A91024",378 // Orange379 "#F19027",380 "#DD731C",381 "#B8461B",382 // Yellow383 "#FFE14F",384 "#FFCF01",385 "#FDB813",386 // Green387 "#8CC63F",388 "#17AF4B",389 "#008A52",390 // Teal391 "#00A6A0",392 "#007670",393 "#006059",394 // Blue395 "#82D1F5",396 "#00B2EF",397 "#00648D",398 "#00B0DA",399 "#008ABF",400 "#003F69",401 // Purple402 "#AB1A86",403 "#7F1C7D",404 "#3B0256",405 // Pink406 "#F389AF",407 "#EE3D96",408 "#BA006E",409 // Taupe410 "#A5A215",411 "#838329",412 "#594F13",413 // Gray414 "#929497",415 "#6D6E70",416 "#404041",417 "#A8A7A5",418 "#83827F",419 "#605F5C"];420 array.forEach(colorList, function(color){421 colors.push(lang.clone(self.getColor(color)));422 });423 return colors;424 },425 /**426 * Gets information of a color.427 * @param {HEX String} color: The HEX value of the color.428 * @return {Object} Information about the color such as the color name.429 */430 getColor: function(color){431 return this.colors[color] || this.getDojoColor(color);432 },433 getColorOrConvert: function(color){434 var result = null;435 if (color){436 result = this.colors[color.toUpperCase()];437 if (!result){438 result = this.getDojoColor(color.toUpperCase());439 if (result){440 result = this.getColor(result.fallback);441 }442 }443 }444 if (!result) {445 result = this.colors["#00B2EF"];446 }447 return result;448 },449 /**450 * Define colors from dijit/ColorPalette.451 */452 dojoColors: {453 "#FFFFFF": {454 name: i18n("White"),455 baseColor: i18n("Gray"),456 value: "#FFFFFF",457 fallback: "#A8A7A5"458 },459 "#D3D3D3": {460 name: i18n("Light Gray"),461 baseColor: i18n("Gray"),462 value: "#D3D3D3",463 fallback: "#A8A7A5"464 },465 "#C0C0C0": {466 name: i18n("Silver"),467 baseColor: i18n("Gray"),468 value: "#C0C0C0",469 fallback: "#A8A7A5"470 },471 "#808080": {472 name: i18n("Gray"),473 baseColor: i18n("Gray"),474 value: "#808080",475 fallback: "#83827F"476 },477 "#696969": {478 name: i18n("Dim Gray"),479 baseColor: i18n("Gray"),480 value: "#696969",481 fallback: "#6D6E70"482 },483 "#2F4F4F": {484 name: i18n("Dark Slate Gray"),485 baseColor: i18n("Gray"),486 value: "#2F4F4F",487 fallback: "#404041"488 },489 "#000000": {490 name: i18n("Black"),491 baseColor: i18n("Gray"),492 value: "#000000",493 fallback: "#404041"494 },495 "#FFF5EE": {496 name: i18n("Seashell"),497 baseColor: i18n("Orange"),498 value: "#FFF5EE",499 fallback: "#F19027"500 },501 "#FFC0CB": {502 name: i18n("Pink"),503 baseColor: i18n("Pink"),504 value: "#FFC0CB",505 fallback: "#F389AF"506 },507 "#F08080": {508 name: i18n("Light Coral"),509 baseColor: i18n("Pink"),510 value: "#F08080",511 fallback: "#F389AF"512 },513 "#FF0000": {514 name: i18n("Red"),515 baseColor: i18n("Red"),516 value: "#FF0000",517 fallback: "#F04E37"518 },519 "#DC143C": {520 name: i18n("Crimson"),521 baseColor: i18n("Red"),522 value: "#DC143C",523 fallback: "#D9182D"524 },525 "#B22222": {526 name: i18n("Fire Brick"),527 baseColor: i18n("Red"),528 value: "#B22222",529 fallback: "#A91024"530 },531 "#8B0000": {532 name: i18n("Dark Red"),533 baseColor: i18n("Red"),534 value: "#8B0000",535 fallback: "#A91024"536 },537 "#FFF8DC": {538 name: i18n("Cornsilk"),539 baseColor: i18n("Yellow"),540 value: "#FFF8DC",541 fallback: "#FFE14F"542 },543 "#FFE4C4": {544 name: i18n("Bisque"),545 baseColor: i18n("Orange"),546 value: "#FFE4C4",547 fallback: "#F19027"548 },549 "#F4A460": {550 name: i18n("Sandy Brown"),551 baseColor: i18n("Orange"),552 value: "#F4A460",553 fallback: "#F19027"554 },555 "#FF4500": {556 name: i18n("Orange Red"),557 baseColor: i18n("Red"),558 value: "#F04E37",559 fallback: "#F19027"560 },561 "#D2691E": {562 name: i18n("Chocolate"),563 baseColor: i18n("Orange"),564 value: "#D2691E",565 fallback: "#DD731C"566 },567 "#8B4513": {568 name: i18n("Saddle Brown"),569 baseColor: i18n("Orange"),570 value: "#8B4513",571 fallback: "#B8461B"572 },573 "#800000": {574 name: i18n("Maroon"),575 baseColor: i18n("Red"),576 value: "#800000",577 fallback: "#A91024"578 },579 "#FFFACD": {580 name: i18n("Lemon Chiffon"),581 baseColor: i18n("Yellow"),582 value: "#FFFACD",583 fallback: "#FFE14F"584 },585 "#FFE4B5": {586 name: i18n("Moccasin"),587 baseColor: i18n("Orange"),588 value: "#FFE4B5",589 fallback: "#F19027"590 },591 "#FFA500": {592 name: i18n("Orange"),593 baseColor: i18n("Orange"),594 value: "#FFA500",595 fallback: "#F19027"596 },597 "#FF8C00": {598 name: i18n("Dark Orange"),599 baseColor: i18n("Orange"),600 value: "#FF8C00",601 fallback: "#F19027"602 },603 "#FF7F50": {604 name: i18n("Coral"),605 baseColor: i18n("Orange"),606 value: "#FF7F50",607 fallback: "#F19027"608 },609 "#A0522D": {610 name: i18n("Sienna"),611 baseColor: i18n("Orange"),612 value: "#A0522D",613 fallback: "#B8461B"614 },615 "#A52A2A": {616 name: i18n("Brown"),617 baseColor: i18n("Red"),618 value: "#A52A2A",619 fallback: "#A91024"620 },621 "#FFFFE0": {622 name: i18n("Light Yellow"),623 baseColor: i18n("Yellow"),624 value: "#FFFFE0",625 fallback: "#FFE14F"626 },627 "#F0E68C": {628 name: i18n("Khaki"),629 baseColor: i18n("Yellow"),630 value: "#F0E68C",631 fallback: "#FFE14F"632 },633 "#EEE8AA": {634 name: i18n("Pale Goldenrod"),635 baseColor: i18n("Yellow"),636 value: "#EEE8AA",637 fallback: "#FFE14F"638 },639 "#FFFF00": {640 name: i18n("Yellow"),641 baseColor: i18n("Yellow"),642 value: "#FFFF00",643 fallback: "#FFCF01"644 },645 "#FFD700": {646 name: i18n("Gold"),647 baseColor: i18n("Yellow"),648 value: "#FFD700",649 fallback: "#FFCF01"650 },651 "#808000": {652 name: i18n("Olive"),653 baseColor: i18n("Taupe"),654 value: "#808000",655 fallback: "#838329"656 },657 "#556B2F": {658 name: i18n("Dark Olive Green"),659 baseColor: i18n("Green"),660 value: "#556B2F",661 fallback: "#008A52"662 },663 "#98FB98": {664 name: i18n("Pale Green"),665 baseColor: i18n("Green"),666 value: "#98FB98",667 fallback: "#8CC63F"668 },669 "#90EE90": {670 name: i18n("Light Green"),671 baseColor: i18n("Green"),672 value: "#90EE90",673 fallback: "#8CC63F"674 },675 "#7FFF00": {676 name: i18n("Chartreuse"),677 baseColor: i18n("Green"),678 value: "#7FFF00",679 fallback: "#8CC63F"680 },681 "#32CD32": {682 name: i18n("Lime Green"),683 baseColor: i18n("Green"),684 value: "#32CD32",685 fallback: "#17AF4B"686 },687 "#228B22": {688 name: i18n("Forest Green"),689 baseColor: i18n("Green"),690 value: "#228B22",691 fallback: "#008A52"692 },693 "#008000": {694 name: i18n("Green"),695 baseColor: i18n("Green"),696 value: "#008000",697 fallback: "#008A52"698 },699 "#006400": {700 name: i18n("Dark Green"),701 baseColor: i18n("Green"),702 value: "#006400",703 fallback: "#008A52"704 },705 "#AFEEEE": {706 name: i18n("Pale Turquoise"),707 baseColor: i18n("Blue"),708 value: "#AFEEEE",709 fallback: "#82D1F5"710 },711 "#20B2AA": {712 name: i18n("Light Sea Green"),713 baseColor: i18n("Teal"),714 value: "#20B2AA",715 fallback: "#00A6A0"716 },717 "#48D1CC": {718 name: i18n("Medium Turquoise"),719 baseColor: i18n("Teal"),720 value: "#48D1CC",721 fallback: "#00A6A0"722 },723 "#8FBC8F": {724 name: i18n("Sea Green"),725 baseColor: i18n("Green"),726 value: "#8FBC8F",727 fallback: "#8CC63F"728 },729 "#2E8B57": {730 name: i18n("Dark Sea Green"),731 baseColor: i18n("Green"),732 value: "#2E8B57",733 fallback: "#008A52"734 },735 "#008B8B": {736 name: i18n("Dark Cyan"),737 baseColor: i18n("Teal"),738 value: "#008B8B",739 fallback: "#007670"740 },741 "#191970": {742 name: i18n("Midnight Blue"),743 baseColor: i18n("Blue"),744 value: "#191970",745 fallback: "#3B0256"746 },747 "#E0FFFF": {748 name: i18n("Light Cyan"),749 baseColor: i18n("Blue"),750 value: "#E0FFFF",751 fallback: "#82D1F5"752 },753 "#87CEFA": {754 name: i18n("Light Sky Blue"),755 baseColor: i18n("Blue"),756 value: "#87CEFA",757 fallback: "#82D1F5"758 },759 "#87CEEB": {760 name: i18n("Sky Blue"),761 baseColor: i18n("Blue"),762 value: "#87CEEB",763 fallback: "#82D1F5"764 },765 "#4169E1": {766 name: i18n("Royal Blue"),767 baseColor: i18n("Blue"),768 value: "#4169E1",769 fallback: "#00648D"770 },771 "#0000FF": {772 name: i18n("Blue"),773 baseColor: i18n("Blue"),774 value: "#0000FF",775 fallback: "#00B2EF"776 },777 "#0000CD": {778 name: i18n("Medium Blue"),779 baseColor: i18n("Blue"),780 value: "#0000CD",781 fallback: "#00648D"782 },783 "#000080": {784 name: i18n("Navy"),785 baseColor: i18n("Blue"),786 value: "#000080",787 fallback: "#003F69"788 },789 "#E6E6FA": {790 name: i18n("Lavender"),791 baseColor: i18n("Purple"),792 value: "#E6E6FA",793 fallback: "#AB1A86"794 },795 "#6495ED": {796 name: i18n("Cornflower Blue"),797 baseColor: i18n("Blue"),798 value: "#6495ED",799 fallback: "#008ABF"800 },801 "#7B68EE": {802 name: i18n("Medium Slate Blue"),803 baseColor: i18n("Blue"),804 value: "#7B68EE",805 fallback: "#008ABF"806 },807 "#6A5ACD": {808 name: i18n("Slate Blue"),809 baseColor: i18n("Blue"),810 value: "#6A5ACD",811 fallback: "#00648D"812 },813 "#8A2BE2": {814 name: i18n("Blue Violet"),815 baseColor: i18n("Purple"),816 value: "#8A2BE2",817 fallback: "#AB1A86"818 },819 "#483D8B": {820 name: i18n("Dark Slate Blue"),821 baseColor: i18n("Purple"),822 value: "#483D8B",823 fallback: "#3B0256"824 },825 "#4B0082": {826 name: i18n("Indigo"),827 baseColor: i18n("Purple"),828 value: "#4B0082",829 fallback: "#3B0256"830 },831 "#DDA0DD": {832 name: i18n("Plum"),833 baseColor: i18n("Purple"),834 value: "#DDA0DD",835 fallback: "#F389AF"836 },837 "#EE82EE": {838 name: i18n("Violet"),839 baseColor: i18n("Purple"),840 value: "#EE82EE",841 fallback: "#F389AF"842 },843 "#DA70D6": {844 name: i18n("Orchid"),845 baseColor: i18n("Purple"),846 value: "#DA70D6",847 fallback: "#AB1A86"848 },849 "#BA55D3": {850 name: i18n("Medium Orchid"),851 baseColor: i18n("Purple"),852 value: "#BA55D3",853 fallback: "#AB1A86"854 },855 "#9932CC": {856 name: i18n("Dark Orchid"),857 baseColor: i18n("Purple"),858 value: "#9932CC",859 fallback: "#AB1A86"860 },861 "#8B008B": {862 name: i18n("Dark Magenta"),863 baseColor: i18n("Purple"),864 value: "#8B008B",865 fallback: "#7F1C7D"866 },867 "#800080": {868 name: i18n("Purple"),869 baseColor: i18n("Purple"),870 value: "#800080",871 fallback: "#7F1C7D"872 },873 "#B3D66D": {874 name: i18n("Yellow Green"),875 baseColor: i18n("Green"),876 value: "#B3D66D",877 fallback: "#8CC63F"878 },879 "default": {880 name: i18n("Cerulean"),881 baseColor: i18n("Blue"),882 fallback: "#00B2EF"883 }884 },885 /**886 * Returns information of a given color, such as name and base color from a color in dijit/ColorPalette.887 * @param {HEX String} color: The value of the color888 * @return {HEX String} Information about the given color.889 */890 getDojoColor: function(color){891 return this.dojoColors[color.toUpperCase()] || this.dojoColors["default"];892 },893 /**894 * Converts a color from dijit/ColorPalette to a color in the IBM Design Language.895 * @param {HEX String} color: The value of the color896 * @return {HEX String} The IBM design language equivalent color.897 */898 dojoToIBM: function(color){899 color = this.dojoColors[color.toUpperCase()];900 if (!color){901 color = this.dojoColors["default"];902 }903 color = color.fallback;904 return color;905 },906 /**907 * @param color: Color defined from the dojo color picker908 * @return base color name on hue (red, orange, yellow, green, blue, purple, or black)909 */910 getBasicColorName: function(color){911 return this.getColor(color).baseColor.toLowerCase();912 }913 };...

Full Screen

Full Screen

blending.js

Source:blending.js Github

copy

Full Screen

1(function(Blotter, _) {2 Blotter.Assets.Shaders.Blending = [3 "//",4 "// Author : Bradley Griffith",5 "// License : Distributed under the MIT License.",6 "//",7 "",8 "// Returns the resulting blend color by blending a top color over a base color",9 "highp vec4 normalBlend(highp vec4 topColor, highp vec4 baseColor) {",10 " highp vec4 blend = vec4(0.0);",11 " // HACK",12 " // Cant divide by 0 (see the 'else' alpha) and after a lot of attempts",13 " // this simply seems like the only solution Im going to be able to come up with to get alpha back.",14 " if (baseColor.a == 1.0) {",15 " baseColor.a = 0.9999999;",16 " };",17 " if (topColor.a >= 1.0) {",18 " blend.a = topColor.a;",19 " blend.r = topColor.r;",20 " blend.g = topColor.g;",21 " blend.b = topColor.b;",22 " } else if (topColor.a == 0.0) {",23 " blend.a = baseColor.a;",24 " blend.r = baseColor.r;",25 " blend.g = baseColor.g;",26 " blend.b = baseColor.b;",27 " } else {",28 " blend.a = 1.0 - (1.0 - topColor.a) * (1.0 - baseColor.a); // alpha",29 " blend.r = (topColor.r * topColor.a / blend.a) + (baseColor.r * baseColor.a * (1.0 - topColor.a) / blend.a);",30 " blend.g = (topColor.g * topColor.a / blend.a) + (baseColor.g * baseColor.a * (1.0 - topColor.a) / blend.a);",31 " blend.b = (topColor.b * topColor.a / blend.a) + (baseColor.b * baseColor.a * (1.0 - topColor.a) / blend.a);",32 " }",33 " return blend;",34 "}",35 "// Returns a vec4 representing the original top color that would have been needed to blend",36 "// against a passed in base color in order to result in the passed in blend color.",37 "highp vec4 normalUnblend(highp vec4 blendColor, highp vec4 baseColor) {",38 " highp vec4 unblend = vec4(0.0);",39 " // HACKY",40 " // Cant divide by 0 (see alpha) and after a lot of attempts",41 " // this simply seems like the only solution Im going to be able to come up with to get alpha back.",42 " if (baseColor.a == 1.0) {",43 " baseColor.a = 0.9999999;",44 " }",45 " unblend.a = 1.0 - ((1.0 - blendColor.a) / (1.0 - baseColor.a));",46 " // Round to two decimal places",47 " unblend.a = (sign(100.0 * unblend.a) * floor(abs(100.0 * unblend.a) + 0.5)) / 100.0;",48 " if (unblend.a >= 1.0) {",49 " unblend.r = blendColor.r;",50 " unblend.g = blendColor.g;",51 " unblend.b = blendColor.b;",52 " } else if (unblend.a == 0.0) {",53 " unblend.r = baseColor.r;",54 " unblend.g = baseColor.g;",55 " unblend.b = baseColor.b;",56 " } else {",57 " unblend.r = (blendColor.r - (baseColor.r * baseColor.a * (1.0 - unblend.a) / blendColor.a)) / (unblend.a / blendColor.a);",58 " unblend.g = (blendColor.g - (baseColor.g * baseColor.a * (1.0 - unblend.a) / blendColor.a)) / (unblend.a / blendColor.a);",59 " unblend.b = (blendColor.b - (baseColor.b * baseColor.a * (1.0 - unblend.a) / blendColor.a)) / (unblend.a / blendColor.a);",60 " }",61 " return unblend;",62 "}",63 ].join("\n");64})(65 this.Blotter, this._...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1var argosy = require('argosy')()2 .use(argosy.pattern({3 }, function (msg, respond) {4 respond(null, { color: 'red' })5 }))6 .use(argosy.pattern({7 }, function (msg, respond) {8 respond(null, { color: 'blue' })9 }))10 .use(argosy.pattern({11 }, function (msg, respond) {12 respond(null, { color: 'green' })13 }))14 .use(argosy.pattern({15 }, function (msg, respond) {16 respond(null, { color: 'yellow' })17 }))18 .use(argosy.pattern({19 }, function (msg, respond) {20 respond(null, { color: 'orange' })21 }))22 .use(argosy.pattern({23 }, function (msg, respond) {24 respond(null, { color: 'purple' })25 }))26 .use(argosy.pattern({27 }, function (msg, respond) {28 respond(null, { color: 'black' })29 }))30 .use(argosy.pattern({31 }, function (msg, respond) {32 respond(null, { color: 'white' })33 }))34 .use(argosy.pattern({35 }, function (msg, respond) {36 respond(null, { color: 'brown' })37 }))38 .use(argosy.pattern({39 }, function (msg, respond) {40 respond(null, { color: 'grey' })41 }))42 .use(argosy.pattern({43 }, function (msg, respond) {44 respond(null, { color: 'pink' })45 }))46 .use(argosy.pattern

Full Screen

Using AI Code Generation

copy

Full Screen

1var colors = require('argosy-colors');2console.log(colors.baseColor('red', 'blue'));3console.log(colors.baseColor('blue', 'red'));4console.log(colors.baseColor('red', 'red'));5console.log(colors.baseColor('blue', 'blue'));6var colors = require('argosy-colors');7console.log(colors.baseColor('red', 'blue', 'green'));8console.log(colors.baseColor('blue', 'red', 'green'));9console.log(colors.baseColor('red', 'red', 'green'));10console.log(colors.baseColor('blue', 'blue', 'green'));11console.log(colors.baseColor('green', 'green', 'green'));12var colors = require('argosy-colors');13console.log(colors.baseColor('red', 'blue', 'green', 'yellow'));14console.log(colors.baseColor('blue', 'red', 'green', 'yellow'));15console.log(colors.baseColor('red', 'red', 'green', 'yellow'));16console.log(colors.baseColor('blue', 'blue', 'green', 'yellow'));17console.log(colors.baseColor('green', 'green', 'green', 'yellow'));18console.log(colors.baseColor('yellow', 'yellow', 'yellow', 'yellow'));19var colors = require('argosy-colors');20console.log(colors.baseColor('red', 'blue', 'green', 'yellow', 'cyan'));21console.log(colors.baseColor('blue', 'red', 'green', 'yellow', 'cyan'));22console.log(colors.baseColor('red', 'red', 'green', 'yellow', 'cyan'));23console.log(colors.baseColor('blue', 'blue', 'green', 'yellow', 'cyan'));24console.log(colors.baseColor('green', 'green', 'green', 'yellow', 'cyan'));25console.log(colors.baseColor('yellow', 'yellow', 'yellow', 'yellow', '

Full Screen

Using AI Code Generation

copy

Full Screen

1var color = require('argosy-color');2console.log(color.baseColor('red'));3console.log(color.baseColor('green'));4console.log(color.baseColor('blue'));5var color = require('argosy-color');6console.log(color.baseColor('red'));7console.log(color.baseColor('green'));8console.log(color.baseColor('blue'));

Full Screen

Using AI Code Generation

copy

Full Screen

1var colors = require('argosy-colors');2var red = colors.baseColor('red');3console.log(red('This is red text'));4var colors = require('argosy-colors');5var red = colors.baseColor('red');6console.log(red('This is red text'));7var colors = require('argosy-colors');8var red = colors.baseColor('red');9console.log(red('This is red text'));10var colors = require('argosy-colors');11var red = colors.baseColor('red');12console.log(red('This is red text'));13var colors = require('argosy-colors');14var red = colors.baseColor('red');15console.log(red('This is red text'));16var colors = require('argosy-colors');17var red = colors.baseColor('red');18console.log(red('This is red text'));19var colors = require('argosy-colors');20var red = colors.baseColor('red');21console.log(red('This is red text'));22var colors = require('argosy-colors');23var red = colors.baseColor('red');24console.log(red('This is red text'));25var colors = require('argosy-colors');26var red = colors.baseColor('red');27console.log(red('This is red text'));28var colors = require('argosy-colors');29var red = colors.baseColor('red');30console.log(red('This is red text'));31var colors = require('

Full Screen

Using AI Code Generation

copy

Full Screen

1var colors = require('argosy-colors');2var color = colors.baseColor('red');3console.log(color);4var colors = require('argosy-colors');5var color = colors.baseColor('red');6console.log(color);7var colors = require('argosy-colors');8var color = colors.baseColor('red');9console.log(color);10var colors = require('argosy-colors');11var color = colors.baseColor('red');12console.log(color);13var colors = require('argosy-colors');14var color = colors.baseColor('red');15console.log(color);16var colors = require('argosy-colors');17var color = colors.baseColor('red');18console.log(color);19var colors = require('argosy-colors');20var color = colors.baseColor('red');21console.log(color);22var colors = require('argosy-colors');23var color = colors.baseColor('red');24console.log(color);25var colors = require('argosy-colors');26var color = colors.baseColor('red');27console.log(color);28var colors = require('argosy-colors');29var color = colors.baseColor('red');30console.log(color);31var colors = require('

Full Screen

Using AI Code Generation

copy

Full Screen

1var argosy = require('argosy');2var baseColor = argosy.patterns.baseColor;3var color = baseColor('red');4var argosy = require('argosy');5var baseColor = argosy.patterns.baseColor;6var color = baseColor('green');7var argosy = require('argosy');8var baseColor = argosy.patterns.baseColor;9var color = baseColor('blue');10var argosy = require('argosy');11var baseColor = argosy.patterns.baseColor;12var color = baseColor('orange');13var argosy = require('argosy');14var baseColor = argosy.patterns.baseColor;15var color = baseColor('yellow');16var argosy = require('argosy');17var baseColor = argosy.patterns.baseColor;18var color = baseColor('purple');19var argosy = require('argosy');20var baseColor = argosy.patterns.baseColor;21var color = baseColor('black');22var argosy = require('argosy');23var baseColor = argosy.patterns.baseColor;24var color = baseColor('white');25var argosy = require('argosy');26var baseColor = argosy.patterns.baseColor;27var color = baseColor('pink');

Full Screen

Using AI Code Generation

copy

Full Screen

1var colors = require('argosy-colors');2var color = colors.baseColor('red');3console.log(color);4var colors = require('argosy-colors');5var color = colors.baseColor('red');6console.log(color);7var colors = require('argosy-colors');8var color = colors.baseColor('red');9console.log(color);10var colors = require('argosy-colors');11var color = colors.baseColor('red');12console.log(color);13var colors = require('argosy-colors');14var color = colors.baseColor('red');15console.log(color);16var colors = require('argosy-colors');17var color = colors.baseColor('red');18console.log(color);19var colors = require('argosy-colors');20var color = colors.baseColor('red');21console.log(color);22var colors = require('argosy-colors');23var color = colors.baseColor('red');24console.log(color);25var colors = require('argosy-colors');26var color = colors.baseColor('red');27console.log(color);28var colors = require('argosy-colors');29var color = colors.baseColor('red');30console.log(color);31var colors = require('argosy-colors');32var color = colors.baseColor('red');33console.log(color);

Full Screen

Using AI Code Generation

copy

Full Screen

1var color = require('argosy-color');2var baseColor = color.baseColor;3var colorObj = color.colorObj;4var colorCode = color.colorCode;5var colorName = color.colorName;6var colorCodeArray = color.colorCodeArray;7var colorNameArray = color.colorNameArray;8var colorObjArray = color.colorObjArray;9var baseColor = baseColor('red');10console.log(baseColor);11var colorObj = colorObj('red');12console.log(colorObj);13var colorCode = colorCode('red');14console.log(colorCode);15var colorName = colorName('red');16console.log(colorName);17var colorCodeArray = colorCodeArray('red');18console.log(colorCodeArray);19var colorNameArray = colorNameArray('red');20console.log(colorNameArray);21var colorObjArray = colorObjArray('red');22console.log(colorObjArray);23var color = require('argosy-color');24var baseColor = color.baseColor;25var colorObj = color.colorObj;26var colorCode = color.colorCode;27var colorName = color.colorName;28var colorCodeArray = color.colorCodeArray;29var colorNameArray = color.colorNameArray;30var colorObjArray = color.colorObjArray;31var baseColor = baseColor(colorObj('red'));32console.log(baseColor);33var colorObj = colorObj(colorObj('red'));34console.log(colorObj);35var colorCode = colorCode(colorObj('red'));36console.log(colorCode);37var colorName = colorName(colorObj('red'));38console.log(colorName);

Full Screen

Using AI Code Generation

copy

Full Screen

1var argosy = require('./argosy'),2 colors = require('colors'),3 path = require('path'),4 fs = require('fs'),5 argosyInstance = argosy();6argosyInstance.use(argosy.patterns.baseColor);7argosyInstance.act('baseColor:colorize', {filePath: path.resolve(__dirname, 'test.txt')}, function (err, result) {8 if (err) {9 console.log(err);10 return;11 }12 console.log(result);13});14var argosy = require('./argosy'),15 colors = require('colors'),16 path = require('path'),17 fs = require('fs'),18 argosyInstance = argosy();19argosyInstance.use(argosy.patterns.baseColor);20argosyInstance.act('baseColor:colorize', {filePath: path.resolve(__dirname, 'test.txt')}, function (err, result) {21 if (err) {22 console.log(err);23 return;24 }25 console.log(result);26});27var argosy = require('./argosy'),28 colors = require('colors'),29 path = require('path'),30 fs = require('fs'),31 argosyInstance = argosy();32argosyInstance.use(argosy.patterns.baseColor);33argosyInstance.act('baseColor:colorize', {filePath: path.resolve(__dirname, 'test.txt')}, function (err, result) {34 if (err) {35 console.log(err);36 return;37 }38 console.log(result);39});40var argosy = require('./argosy'),41 colors = require('

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run argos automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful