Best JavaScript code snippet using taiko
GenericAnatomyColors.js
Source:GenericAnatomyColors.js
...13function componentToHex(c) {14 const hex = c.toString(16);15 return hex.length === 1 ? '0' + hex : hex;16}17function rgbToHex(r, g, b) {18 return '#' + componentToHex(r) + componentToHex(g) + componentToHex(b);19}20export const GenericNames = [21 'james',22 'robert',23 'john',24 'michael',25 'william',26 'david',27 'richard',28 'joseph',29 'thomas',30 'charles',31 'christopher',32 'daniel',33 'matthew',34 'anthony',35 'mark',36 'donald',37 'steven',38 'paul',39 'andrew',40 'joshua',41 'kenneth',42 'kevin',43 'brian',44 'george',45 'edward',46 'ronald',47 'timothy',48 'jason',49 'jeffrey',50 'ryan',51 'jacob',52 'gary',53 'nicholas',54 'eric',55 'jonathan',56 'stephen',57 'larry',58 'justin',59 'scott',60 'brandon',61 'benjamin',62 'samuel',63 'gregory',64 'frank',65 'alexander',66 'raymond',67 'patrick',68 'jack',69 'dennis',70 'jerry',71 'tyler',72 'aaron',73 'jose',74 'adam',75 'henry',76 'nathan',77 'douglas',78 'zachary',79 'peter',80 'kyle',81 'walter',82 'ethan',83 'jeremy',84 'harold',85 'keith',86 'christian',87 'roger',88 'noah',89 'gerald',90 'carl',91 'terry',92 'sean',93 'austin',94 'arthur',95 'lawrence',96 'jesse',97 'dylan',98 'bryan',99 'joe',100 'jordan',101 'billy',102 'bruce',103 'albert',104 'willie',105 'gabriel',106 'logan',107 'alan',108 'juan',109 'wayne',110 'roy',111 'ralph',112 'randy',113 'eugene',114 'vincent',115 'russell',116 'elijah',117 'louis',118 'bobby',119 'philip',120 'johnny',121 'mary',122 'patricia',123 'jennifer',124 'linda',125 'elizabeth',126 'barbara',127 'susan',128 'jessica',129 'sarah',130 'karen',131 'nancy',132 'lisa',133 'betty',134 'margaret',135 'sandra',136 'ashley',137 'kimberly',138 'emily',139 'donna',140 'michelle',141 'dorothy',142 'carol',143 'amanda',144 'melissa',145 'deborah',146 'stephanie',147 'rebecca',148 'sharon',149 'laura',150 'cynthia',151 'kathleen',152 'amy',153 'shirley',154 'angela',155 'helen',156 'anna',157 'brenda',158 'pamela',159 'nicole',160 'emma',161 'samantha',162 'katherine',163 'christine',164 'debra',165 'rachel',166 'catherine',167 'carolyn',168 'janet',169 'ruth',170 'maria',171 'heather',172 'diane',173 'virginia',174 'julie',175 'joyce',176 'victoria',177 'olivia',178 'kelly',179 'christina',180 'lauren',181 'joan',182 'evelyn',183 'judith',184 'megan',185 'cheryl',186 'andrea',187 'hannah',188 'martha',189 'jacqueline',190 'frances',191 'gloria',192 'ann',193 'teresa',194 'kathryn',195 'sara',196 'janice',197 'jean',198 'alice',199 'madison',200 'doris',201 'abigail',202 'julia',203 'judy',204 'grace',205 'denise',206 'amber',207 'marilyn',208 'beverly',209 'danielle',210 'theresa',211 'sophia',212 'marie',213 'diana',214 'brittany',215 'natalie',216 'isabella',217 'charlotte',218 'rose',219 'alexis',220 'kayla',221];222export const GenericAnatomyColors = [223 { label: 'background', value: rgbToHex(0, 0, 0) },224 { label: 'tissue', value: rgbToHex(128, 174, 128) },225 { label: 'bone', value: rgbToHex(241, 214, 145) },226 { label: 'skin', value: rgbToHex(177, 122, 101) },227 { label: 'connective tissue', value: rgbToHex(111, 184, 210) },228 { label: 'blood', value: rgbToHex(216, 101, 79) },229 { label: 'organ', value: rgbToHex(221, 130, 101) },230 { label: 'mass', value: rgbToHex(144, 238, 144) },231 { label: 'muscle', value: rgbToHex(192, 104, 88) },232 { label: 'foreign object', value: rgbToHex(220, 245, 20) },233 { label: 'waste', value: rgbToHex(78, 63, 0) },234 { label: 'teeth', value: rgbToHex(255, 250, 220) },235 { label: 'fat', value: rgbToHex(230, 220, 70) },236 { label: 'gray matter', value: rgbToHex(200, 200, 235) },237 { label: 'white matter', value: rgbToHex(250, 250, 210) },238 { label: 'nerve', value: rgbToHex(244, 214, 49) },239 { label: 'vein', value: rgbToHex(0, 151, 206) },240 { label: 'artery', value: rgbToHex(216, 101, 79) },241 { label: 'capillary', value: rgbToHex(183, 156, 220) },242 { label: 'ligament', value: rgbToHex(183, 214, 211) },243 { label: 'tendon', value: rgbToHex(152, 189, 207) },244 { label: 'cartilage', value: rgbToHex(111, 184, 210) },245 { label: 'meniscus', value: rgbToHex(178, 212, 242) },246 { label: 'lymph node', value: rgbToHex(68, 172, 100) },247 { label: 'lymphatic vessel', value: rgbToHex(111, 197, 131) },248 { label: 'cerebro-spinal fluid', value: rgbToHex(85, 188, 255) },249 { label: 'bile', value: rgbToHex(0, 145, 30) },250 { label: 'urine', value: rgbToHex(214, 230, 130) },251 { label: 'feces', value: rgbToHex(78, 63, 0) },252 { label: 'gas', value: rgbToHex(218, 255, 255) },253 { label: 'fluid', value: rgbToHex(170, 250, 250) },254 { label: 'edema', value: rgbToHex(140, 224, 228) },255 { label: 'bleeding', value: rgbToHex(188, 65, 28) },256 { label: 'necrosis', value: rgbToHex(216, 191, 216) },257 { label: 'clot', value: rgbToHex(145, 60, 66) },258 { label: 'embolism', value: rgbToHex(150, 98, 83) },259 { label: 'head', value: rgbToHex(177, 122, 101) },260 { label: 'central nervous system', value: rgbToHex(244, 214, 49) },261 { label: 'brain', value: rgbToHex(250, 250, 225) },262 { label: 'gray matter of brain', value: rgbToHex(200, 200, 215) },263 { label: 'telencephalon', value: rgbToHex(68, 131, 98) },264 { label: 'cerebral cortex', value: rgbToHex(128, 174, 128) },265 { label: 'right frontal lobe', value: rgbToHex(83, 146, 164) },266 { label: 'left frontal lobe', value: rgbToHex(83, 146, 164) },267 { label: 'right temporal lobe', value: rgbToHex(162, 115, 105) },268 { label: 'left temporal lobe', value: rgbToHex(162, 115, 105) },269 { label: 'right parietal lobe', value: rgbToHex(141, 93, 137) },270 { label: 'left parietal lobe', value: rgbToHex(141, 93, 137) },271 { label: 'right occipital lobe', value: rgbToHex(182, 166, 110) },272 { label: 'left occipital lobe', value: rgbToHex(182, 166, 110) },273 { label: 'right insular lobe', value: rgbToHex(188, 135, 166) },274 { label: 'left insular lobe', value: rgbToHex(188, 135, 166) },275 { label: 'right limbic lobe', value: rgbToHex(154, 150, 201) },276 { label: 'left limbic lobe', value: rgbToHex(154, 150, 201) },277 { label: 'right striatum', value: rgbToHex(177, 140, 190) },278 { label: 'left striatum', value: rgbToHex(177, 140, 190) },279 { label: 'right caudate nucleus', value: rgbToHex(30, 111, 85) },280 { label: 'left caudate nucleus', value: rgbToHex(30, 111, 85) },281 { label: 'right putamen', value: rgbToHex(210, 157, 166) },282 { label: 'left putamen', value: rgbToHex(210, 157, 166) },283 { label: 'right pallidum', value: rgbToHex(48, 129, 126) },284 { label: 'left pallidum', value: rgbToHex(48, 129, 126) },285 { label: 'right amygdaloid complex', value: rgbToHex(98, 153, 112) },286 { label: 'left amygdaloid complex', value: rgbToHex(98, 153, 112) },287 { label: 'diencephalon', value: rgbToHex(69, 110, 53) },288 { label: 'thalamus', value: rgbToHex(166, 113, 137) },289 { label: 'right thalamus', value: rgbToHex(122, 101, 38) },290 { label: 'left thalamus', value: rgbToHex(122, 101, 38) },291 { label: 'pineal gland', value: rgbToHex(253, 135, 192) },292 { label: 'midbrain', value: rgbToHex(145, 92, 109) },293 { label: 'substantia nigra', value: rgbToHex(46, 101, 131) },294 { label: 'right substantia nigra', value: rgbToHex(0, 108, 112) },295 { label: 'left substantia nigra', value: rgbToHex(0, 108, 112) },296 { label: 'cerebral white matter', value: rgbToHex(250, 250, 225) },297 {298 label: 'right superior longitudinal fasciculus',299 value: rgbToHex(127, 150, 88),300 },301 {302 label: 'left superior longitudinal fasciculus',303 value: rgbToHex(127, 150, 88),304 },305 {306 label: 'right inferior longitudinal fasciculus',307 value: rgbToHex(159, 116, 163),308 },309 {310 label: 'left inferior longitudinal fasciculus',311 value: rgbToHex(159, 116, 163),312 },313 { label: 'right arcuate fasciculus', value: rgbToHex(125, 102, 154) },314 { label: 'left arcuate fasciculus', value: rgbToHex(125, 102, 154) },315 { label: 'right uncinate fasciculus', value: rgbToHex(106, 174, 155) },316 { label: 'left uncinate fasciculus', value: rgbToHex(106, 174, 155) },317 { label: 'right cingulum bundle', value: rgbToHex(154, 146, 83) },318 { label: 'left cingulum bundle', value: rgbToHex(154, 146, 83) },319 { label: 'projection fibers', value: rgbToHex(126, 126, 55) },320 { label: 'right corticospinal tract', value: rgbToHex(201, 160, 133) },321 { label: 'left corticospinal tract', value: rgbToHex(201, 160, 133) },322 { label: 'right optic radiation', value: rgbToHex(78, 152, 141) },323 { label: 'left optic radiation', value: rgbToHex(78, 152, 141) },324 { label: 'right medial lemniscus', value: rgbToHex(174, 140, 103) },325 { label: 'left medial lemniscus', value: rgbToHex(174, 140, 103) },326 {327 label: 'right superior cerebellar peduncle',328 value: rgbToHex(139, 126, 177),329 },330 {331 label: 'left superior cerebellar peduncle',332 value: rgbToHex(139, 126, 177),333 },334 { label: 'right middle cerebellar peduncle', value: rgbToHex(148, 120, 72) },335 { label: 'left middle cerebellar peduncle', value: rgbToHex(148, 120, 72) },336 {337 label: 'right inferior cerebellar peduncle',338 value: rgbToHex(186, 135, 135),339 },340 {341 label: 'left inferior cerebellar peduncle',342 value: rgbToHex(186, 135, 135),343 },344 { label: 'optic chiasm', value: rgbToHex(99, 106, 24) },345 { label: 'right optic tract', value: rgbToHex(156, 171, 108) },346 { label: 'left optic tract', value: rgbToHex(156, 171, 108) },347 { label: 'right fornix', value: rgbToHex(64, 123, 147) },348 { label: 'left fornix', value: rgbToHex(64, 123, 147) },349 { label: 'commissural fibers', value: rgbToHex(138, 95, 74) },350 { label: 'corpus callosum', value: rgbToHex(97, 113, 158) },351 { label: 'posterior commissure', value: rgbToHex(126, 161, 197) },352 { label: 'cerebellar white matter', value: rgbToHex(194, 195, 164) },353 { label: 'CSF space', value: rgbToHex(85, 188, 255) },354 { label: 'ventricles of brain', value: rgbToHex(88, 106, 215) },355 { label: 'right lateral ventricle', value: rgbToHex(88, 106, 215) },356 { label: 'left lateral ventricle', value: rgbToHex(88, 106, 215) },357 { label: 'right third ventricle', value: rgbToHex(88, 106, 215) },358 { label: 'left third ventricle', value: rgbToHex(88, 106, 215) },359 { label: 'cerebral aqueduct', value: rgbToHex(88, 106, 215) },360 { label: 'fourth ventricle', value: rgbToHex(88, 106, 215) },361 { label: 'subarachnoid space', value: rgbToHex(88, 106, 215) },362 { label: 'spinal cord', value: rgbToHex(244, 214, 49) },363 { label: 'gray matter of spinal cord', value: rgbToHex(200, 200, 215) },364 { label: 'white matter of spinal cord', value: rgbToHex(250, 250, 225) },365 { label: 'endocrine system of brain', value: rgbToHex(82, 174, 128) },366 { label: 'pituitary gland', value: rgbToHex(57, 157, 110) },367 { label: 'adenohypophysis', value: rgbToHex(60, 143, 83) },368 { label: 'neurohypophysis', value: rgbToHex(92, 162, 109) },369 { label: 'meninges', value: rgbToHex(255, 244, 209) },370 { label: 'dura mater', value: rgbToHex(255, 244, 209) },371 { label: 'arachnoid', value: rgbToHex(255, 244, 209) },372 { label: 'pia mater', value: rgbToHex(255, 244, 209) },373 { label: 'muscles of head', value: rgbToHex(201, 121, 77) },374 { label: 'salivary glands', value: rgbToHex(70, 163, 117) },375 { label: 'lips', value: rgbToHex(188, 91, 95) },376 { label: 'nose', value: rgbToHex(177, 122, 101) },377 { label: 'tongue', value: rgbToHex(166, 84, 94) },378 { label: 'soft palate', value: rgbToHex(182, 105, 107) },379 { label: 'right inner ear', value: rgbToHex(229, 147, 118) },380 { label: 'left inner ear', value: rgbToHex(229, 147, 118) },381 { label: 'right external ear', value: rgbToHex(174, 122, 90) },382 { label: 'left external ear', value: rgbToHex(174, 122, 90) },383 { label: 'right middle ear', value: rgbToHex(201, 112, 73) },384 { label: 'left middle ear', value: rgbToHex(201, 112, 73) },385 { label: 'right eyeball', value: rgbToHex(194, 142, 0) },386 { label: 'left eyeball', value: rgbToHex(194, 142, 0) },387 { label: 'skull', value: rgbToHex(241, 213, 144) },388 { label: 'right frontal bone', value: rgbToHex(203, 179, 77) },389 { label: 'left frontal bone', value: rgbToHex(203, 179, 77) },390 { label: 'right parietal bone', value: rgbToHex(229, 204, 109) },391 { label: 'left parietal bone', value: rgbToHex(229, 204, 109) },392 { label: 'right temporal bone', value: rgbToHex(255, 243, 152) },393 { label: 'left temporal bone', value: rgbToHex(255, 243, 152) },394 { label: 'right sphenoid bone', value: rgbToHex(209, 185, 85) },395 { label: 'left sphenoid bone', value: rgbToHex(209, 185, 85) },396 { label: 'right ethmoid bone', value: rgbToHex(248, 223, 131) },397 { label: 'left ethmoid bone', value: rgbToHex(248, 223, 131) },398 { label: 'occipital bone', value: rgbToHex(255, 230, 138) },399 { label: 'maxilla', value: rgbToHex(196, 172, 68) },400 { label: 'right zygomatic bone', value: rgbToHex(255, 255, 167) },401 { label: 'right lacrimal bone', value: rgbToHex(255, 250, 160) },402 { label: 'vomer bone', value: rgbToHex(255, 237, 145) },403 { label: 'right palatine bone', value: rgbToHex(242, 217, 123) },404 { label: 'left palatine bone', value: rgbToHex(242, 217, 123) },405 { label: 'mandible', value: rgbToHex(222, 198, 101) },406 { label: 'neck', value: rgbToHex(177, 122, 101) },407 { label: 'muscles of neck', value: rgbToHex(213, 124, 109) },408 { label: 'pharynx', value: rgbToHex(184, 105, 108) },409 { label: 'larynx', value: rgbToHex(150, 208, 243) },410 { label: 'thyroid gland', value: rgbToHex(62, 162, 114) },411 { label: 'right parathyroid glands', value: rgbToHex(62, 162, 114) },412 { label: 'left parathyroid glands', value: rgbToHex(62, 162, 114) },413 { label: 'skeleton of neck', value: rgbToHex(242, 206, 142) },414 { label: 'hyoid bone', value: rgbToHex(250, 210, 139) },415 { label: 'cervical vertebral column', value: rgbToHex(255, 255, 207) },416 { label: 'thorax', value: rgbToHex(177, 122, 101) },417 { label: 'trachea', value: rgbToHex(182, 228, 255) },418 { label: 'bronchi', value: rgbToHex(175, 216, 244) },419 { label: 'right lung', value: rgbToHex(197, 165, 145) },420 { label: 'left lung', value: rgbToHex(197, 165, 145) },421 { label: 'superior lobe of right lung', value: rgbToHex(172, 138, 115) },422 { label: 'superior lobe of left lung', value: rgbToHex(172, 138, 115) },423 { label: 'middle lobe of right lung', value: rgbToHex(202, 164, 140) },424 { label: 'inferior lobe of right lung', value: rgbToHex(224, 186, 162) },425 { label: 'inferior lobe of left lung', value: rgbToHex(224, 186, 162) },426 { label: 'pleura', value: rgbToHex(255, 245, 217) },427 { label: 'heart', value: rgbToHex(206, 110, 84) },428 { label: 'right atrium', value: rgbToHex(210, 115, 89) },429 { label: 'left atrium', value: rgbToHex(203, 108, 81) },430 { label: 'atrial septum', value: rgbToHex(233, 138, 112) },431 { label: 'ventricular septum', value: rgbToHex(195, 100, 73) },432 { label: 'right ventricle of heart', value: rgbToHex(181, 85, 57) },433 { label: 'left ventricle of heart', value: rgbToHex(152, 55, 13) },434 { label: 'mitral valve', value: rgbToHex(159, 63, 27) },435 { label: 'tricuspid valve', value: rgbToHex(166, 70, 38) },436 { label: 'aortic valve', value: rgbToHex(218, 123, 97) },437 { label: 'pulmonary valve', value: rgbToHex(225, 130, 104) },438 { label: 'aorta', value: rgbToHex(224, 97, 76) },439 { label: 'pericardium', value: rgbToHex(255, 244, 209) },440 { label: 'pericardial cavity', value: rgbToHex(184, 122, 154) },441 { label: 'esophagus', value: rgbToHex(211, 171, 143) },442 { label: 'thymus', value: rgbToHex(47, 150, 103) },443 { label: 'mediastinum', value: rgbToHex(255, 244, 209) },444 { label: 'skin of thoracic wall', value: rgbToHex(173, 121, 88) },445 { label: 'muscles of thoracic wall', value: rgbToHex(188, 95, 76) },446 { label: 'skeleton of thorax', value: rgbToHex(255, 239, 172) },447 { label: 'thoracic vertebral column', value: rgbToHex(226, 202, 134) },448 { label: 'ribs', value: rgbToHex(253, 232, 158) },449 { label: 'sternum', value: rgbToHex(244, 217, 154) },450 { label: 'right clavicle', value: rgbToHex(205, 179, 108) },451 { label: 'left clavicle', value: rgbToHex(205, 179, 108) },452 { label: 'abdominal cavity', value: rgbToHex(186, 124, 161) },453 { label: 'abdomen', value: rgbToHex(177, 122, 101) },454 { label: 'peritoneum', value: rgbToHex(255, 255, 220) },455 { label: 'omentum', value: rgbToHex(234, 234, 194) },456 { label: 'peritoneal cavity', value: rgbToHex(204, 142, 178) },457 { label: 'retroperitoneal space', value: rgbToHex(180, 119, 153) },458 { label: 'stomach', value: rgbToHex(216, 132, 105) },459 { label: 'duodenum', value: rgbToHex(255, 253, 229) },460 { label: 'small bowel', value: rgbToHex(205, 167, 142) },461 { label: 'colon', value: rgbToHex(204, 168, 143) },462 { label: 'anus', value: rgbToHex(255, 224, 199) },463 { label: 'liver', value: rgbToHex(221, 130, 101) },464 { label: 'biliary tree', value: rgbToHex(0, 145, 30) },465 { label: 'gallbladder', value: rgbToHex(139, 150, 98) },466 { label: 'pancreas', value: rgbToHex(249, 180, 111) },467 { label: 'spleen', value: rgbToHex(157, 108, 162) },468 { label: 'urinary system', value: rgbToHex(203, 136, 116) },469 { label: 'right kidney', value: rgbToHex(185, 102, 83) },470 { label: 'left kidney', value: rgbToHex(185, 102, 83) },471 { label: 'right ureter', value: rgbToHex(247, 182, 164) },472 { label: 'left ureter', value: rgbToHex(247, 182, 164) },473 { label: 'urinary bladder', value: rgbToHex(222, 154, 132) },474 { label: 'urethra', value: rgbToHex(124, 186, 223) },475 { label: 'right adrenal gland', value: rgbToHex(249, 186, 150) },476 { label: 'left adrenal gland', value: rgbToHex(249, 186, 150) },477 { label: 'female internal genitalia', value: rgbToHex(244, 170, 147) },478 { label: 'uterus', value: rgbToHex(255, 181, 158) },479 { label: 'right fallopian tube', value: rgbToHex(255, 190, 165) },480 { label: 'left fallopian tube', value: rgbToHex(227, 153, 130) },481 { label: 'right ovary', value: rgbToHex(213, 141, 113) },482 { label: 'left ovary', value: rgbToHex(213, 141, 113) },483 { label: 'vagina', value: rgbToHex(193, 123, 103) },484 { label: 'male internal genitalia', value: rgbToHex(216, 146, 127) },485 { label: 'prostate', value: rgbToHex(230, 158, 140) },486 { label: 'right seminal vesicle', value: rgbToHex(245, 172, 147) },487 { label: 'left seminal vesicle', value: rgbToHex(245, 172, 147) },488 { label: 'right deferent duct', value: rgbToHex(241, 172, 151) },489 { label: 'left deferent duct', value: rgbToHex(241, 172, 151) },490 { label: 'skin of abdominal wall', value: rgbToHex(177, 124, 92) },491 { label: 'muscles of abdominal wall', value: rgbToHex(171, 85, 68) },492 { label: 'skeleton of abdomen', value: rgbToHex(217, 198, 131) },493 { label: 'lumbar vertebral column', value: rgbToHex(212, 188, 102) },494 { label: 'female external genitalia', value: rgbToHex(185, 135, 134) },495 { label: 'male external genitalia', value: rgbToHex(185, 135, 134) },496 { label: 'skeleton of upper limb', value: rgbToHex(198, 175, 125) },497 { label: 'muscles of upper limb', value: rgbToHex(194, 98, 79) },498 { label: 'right upper limb', value: rgbToHex(177, 122, 101) },499 { label: 'left upper limb', value: rgbToHex(177, 122, 101) },500 { label: 'right shoulder', value: rgbToHex(177, 122, 101) },501 { label: 'left shoulder', value: rgbToHex(177, 122, 101) },502 { label: 'right arm', value: rgbToHex(177, 122, 101) },503 { label: 'left arm', value: rgbToHex(177, 122, 101) },504 { label: 'right elbow', value: rgbToHex(177, 122, 101) },505 { label: 'left elbow', value: rgbToHex(177, 122, 101) },506 { label: 'right forearm', value: rgbToHex(177, 122, 101) },507 { label: 'left forearm', value: rgbToHex(177, 122, 101) },508 { label: 'right wrist', value: rgbToHex(177, 122, 101) },509 { label: 'left wrist', value: rgbToHex(177, 122, 101) },510 { label: 'right hand', value: rgbToHex(177, 122, 101) },511 { label: 'left hand', value: rgbToHex(177, 122, 101) },512 { label: 'skeleton of lower limb', value: rgbToHex(255, 238, 170) },513 { label: 'muscles of lower limb', value: rgbToHex(206, 111, 93) },514 { label: 'right lower limb', value: rgbToHex(177, 122, 101) },515 { label: 'left lower limb', value: rgbToHex(177, 122, 101) },516 { label: 'right hip', value: rgbToHex(177, 122, 101) },517 { label: 'left hip', value: rgbToHex(177, 122, 101) },518 { label: 'right thigh', value: rgbToHex(177, 122, 101) },519 { label: 'left thigh', value: rgbToHex(177, 122, 101) },520 { label: 'right knee', value: rgbToHex(177, 122, 101) },521 { label: 'left knee', value: rgbToHex(177, 122, 101) },522 { label: 'right leg', value: rgbToHex(177, 122, 101) },523 { label: 'left leg', value: rgbToHex(177, 122, 101) },524 { label: 'right foot', value: rgbToHex(177, 122, 101) },525 { label: 'left foot', value: rgbToHex(177, 122, 101) },526 { label: 'peripheral nervous system', value: rgbToHex(216, 186, 0) },527 { label: 'autonomic nerve', value: rgbToHex(255, 226, 77) },528 { label: 'sympathetic trunk', value: rgbToHex(255, 243, 106) },529 { label: 'cranial nerves', value: rgbToHex(255, 234, 92) },530 { label: 'vagus nerve', value: rgbToHex(240, 210, 35) },531 { label: 'peripheral nerve', value: rgbToHex(224, 194, 0) },532 { label: 'circulatory system', value: rgbToHex(213, 99, 79) },533 { label: 'systemic arterial system', value: rgbToHex(217, 102, 81) },534 { label: 'systemic venous system', value: rgbToHex(0, 147, 202) },535 { label: 'pulmonary arterial system', value: rgbToHex(0, 122, 171) },536 { label: 'pulmonary venous system', value: rgbToHex(186, 77, 64) },537 { label: 'lymphatic system', value: rgbToHex(111, 197, 131) },538 { label: 'needle', value: rgbToHex(240, 255, 30) },539 { label: 'region 0', value: rgbToHex(185, 232, 61) },540 { label: 'region 1', value: rgbToHex(0, 226, 255) },541 { label: 'region 2', value: rgbToHex(251, 159, 255) },542 { label: 'region 3', value: rgbToHex(230, 169, 29) },543 { label: 'region 4', value: rgbToHex(0, 194, 113) },544 { label: 'region 5', value: rgbToHex(104, 160, 249) },545 { label: 'region 6', value: rgbToHex(221, 108, 158) },546 { label: 'region 7', value: rgbToHex(137, 142, 0) },547 { label: 'region 8', value: rgbToHex(230, 70, 0) },548 { label: 'region 9', value: rgbToHex(0, 147, 0) },549 { label: 'region 10', value: rgbToHex(0, 147, 248) },550 { label: 'region 11', value: rgbToHex(231, 0, 206) },551 { label: 'region 12', value: rgbToHex(129, 78, 0) },552 { label: 'region 13', value: rgbToHex(0, 116, 0) },553 { label: 'region 14', value: rgbToHex(0, 0, 255) },554 { label: 'region 15', value: rgbToHex(157, 0, 0) },555 { label: 'unknown', value: rgbToHex(100, 100, 130) },556 { label: 'cyst', value: rgbToHex(205, 205, 100) },...
generators.js
Source:generators.js
...11 return result;12 }13 if (color && color !== '-') {14 rgb = getColorRgb(color, palette);15 gColor = rgbToHex(...rgb);16 cColor = rgbTox255(rgb);17 }18 result[`gui${kind}`] = gColor;19 if (kind !== 'sp') {20 result[`cterm${kind}`] = cColor;21 }22 return result;23}24export function hiStyle(style) {25 const result = {};26 const attributes = {27 b: 'bold',28 u: 'underline',29 r: 'reverse',30 i: 'italic',31 c: 'undercurl',32 s: 'standout',33 };34 let fontStyle = 'NONE';35 if (style === '.') {36 return result;37 }38 if (style && style !== '-') {39 fontStyle = style40 .split('')41 .map((s) => attributes[s])42 .join(',');43 }44 result.gui = fontStyle;45 result.cterm = fontStyle;46 return result;47}48export function toHiString(name, params = []) {49 return `hi ${name} ${params50 .map(51 (param) =>52 `${Object.keys(param)53 .map((key) => `${key}=${param[key]}`)54 .join(' ')}`55 )56 .join(' ')}`;57}58export function generateColor(name, config = '', palette = {}) {59 if (!config) {60 return '';61 }62 const params = [];63 const [fg, bg, style, sp] = config.split(' ');64 params.push(hiColor('fg', fg, palette));65 params.push(hiColor('bg', bg, palette));66 params.push(hiStyle(style));67 params.push(hiColor('sp', sp, palette));68 return toHiString(name, params);69}70export function generateHeader(info = {}) {71 return `72" Maintainer: ${info.author}73set background=${info.background}74hi clear75if exists('syntax_on')76 syntax reset77endif78let g:colors_name='${info.name}'79`;80}81export function generateTheme(data = {}) {82 let theme = generateHeader(data.info);83 Object.keys(data.highlights).forEach((key) => {84 theme += `\n${generateColor(key, data.highlights[key], data.palette)}`;85 });86 return theme;87}88export function generateLualineTheme(data = {}) {89 return `90 local ${data.info.name} = {91 inactive = {92 a = { fg = '${rgbToHex(93 ...getColorRgb(data.lualine.inactive.a.fg, data.palette)94 )}', bg = '${rgbToHex(95 ...getColorRgb(data.lualine.inactive.a.bg, data.palette)96 )}' ${97 data.lualine.inactive.a.gui98 ? `, gui = '${data.lualine.inactive.a.gui}'`99 : ''100 } },101 b = { fg = '${rgbToHex(102 ...getColorRgb(data.lualine.inactive.b.fg, data.palette)103 )}', bg = '${rgbToHex(104 ...getColorRgb(data.lualine.inactive.b.bg, data.palette)105 )}' },106 c = { fg = '${rgbToHex(107 ...getColorRgb(data.lualine.inactive.c.fg, data.palette)108 )}', bg = '${rgbToHex(109 ...getColorRgb(data.lualine.inactive.c.bg, data.palette)110 )}' },111 },112 normal = {113 a = { fg = '${rgbToHex(114 ...getColorRgb(data.lualine.normal.a.fg, data.palette)115 )}', bg = '${rgbToHex(116 ...getColorRgb(data.lualine.normal.a.bg, data.palette)117 )}' ${118 data.lualine.normal.a.gui ? `, gui = '${data.lualine.normal.a.gui}'` : ''119 } },120 b = { fg = '${rgbToHex(121 ...getColorRgb(data.lualine.normal.b.fg, data.palette)122 )}', bg = '${rgbToHex(123 ...getColorRgb(data.lualine.normal.b.bg, data.palette)124 )}' },125 c = { fg = '${rgbToHex(126 ...getColorRgb(data.lualine.normal.c.fg, data.palette)127 )}', bg = '${rgbToHex(128 ...getColorRgb(data.lualine.normal.c.bg, data.palette)129 )}' },130 },131 insert = {132 a = { fg = '${rgbToHex(133 ...getColorRgb(data.lualine.insert.a.fg, data.palette)134 )}', bg = '${rgbToHex(135 ...getColorRgb(data.lualine.insert.a.bg, data.palette)136 )}' ${137 data.lualine.insert.a.gui ? `, gui = '${data.lualine.insert.a.gui}'` : ''138 } },139 b = { fg = '${rgbToHex(140 ...getColorRgb(data.lualine.insert.b.fg, data.palette)141 )}', bg = '${rgbToHex(142 ...getColorRgb(data.lualine.insert.b.bg, data.palette)143 )}' },144 c = { fg = '${rgbToHex(145 ...getColorRgb(data.lualine.insert.c.fg, data.palette)146 )}', bg = '${rgbToHex(147 ...getColorRgb(data.lualine.insert.c.bg, data.palette)148 )}' },149 },150 visual = {151 a = { fg = '${rgbToHex(152 ...getColorRgb(data.lualine.visual.a.fg, data.palette)153 )}', bg = '${rgbToHex(154 ...getColorRgb(data.lualine.visual.a.bg, data.palette)155 )}' ${156 data.lualine.visual.a.gui ? `, gui = '${data.lualine.visual.a.gui}'` : ''157 } },158 b = { fg = '${rgbToHex(159 ...getColorRgb(data.lualine.visual.b.fg, data.palette)160 )}', bg = '${rgbToHex(161 ...getColorRgb(data.lualine.visual.b.bg, data.palette)162 )}' },163 c = { fg = '${rgbToHex(164 ...getColorRgb(data.lualine.visual.c.fg, data.palette)165 )}', bg = '${rgbToHex(166 ...getColorRgb(data.lualine.visual.c.bg, data.palette)167 )}' },168 },169 replace = {170 a = { fg = '${rgbToHex(171 ...getColorRgb(data.lualine.replace.a.fg, data.palette)172 )}', bg = '${rgbToHex(173 ...getColorRgb(data.lualine.replace.a.bg, data.palette)174 )}' ${175 data.lualine.replace.a.gui ? `, gui = '${data.lualine.replace.a.gui}'` : ''176 } },177 b = { fg = '${rgbToHex(178 ...getColorRgb(data.lualine.replace.b.fg, data.palette)179 )}', bg = '${rgbToHex(180 ...getColorRgb(data.lualine.replace.b.bg, data.palette)181 )}' },182 c = { fg = '${rgbToHex(183 ...getColorRgb(data.lualine.replace.c.fg, data.palette)184 )}', bg = '${rgbToHex(185 ...getColorRgb(data.lualine.replace.c.bg, data.palette)186 )}' },187 },188 command = {189 a = { fg = '${rgbToHex(190 ...getColorRgb(data.lualine.command.a.fg, data.palette)191 )}', bg = '${rgbToHex(192 ...getColorRgb(data.lualine.command.a.bg, data.palette)193 )}' ${194 data.lualine.command.a.gui ? `, gui = '${data.lualine.command.a.gui}'` : ''195 } },196 b = { fg = '${rgbToHex(197 ...getColorRgb(data.lualine.command.b.fg, data.palette)198 )}', bg = '${rgbToHex(199 ...getColorRgb(data.lualine.command.b.bg, data.palette)200 )}' },201 c = { fg = '${rgbToHex(202 ...getColorRgb(data.lualine.command.c.fg, data.palette)203 )}', bg = '${rgbToHex(204 ...getColorRgb(data.lualine.command.c.bg, data.palette)205 )}' },206 },207 }208 return ${data.info.name};209 `;210}211export function generateWeztermTheme(data = {}) {212 return `213[colors]214foreground = "${rgbToHex(215 ...getColorRgb(data.wezterm.foreground, data.palette)216 )}"217background = "${rgbToHex(218 ...getColorRgb(data.wezterm.background, data.palette)219 )}"220cursor_bg = "${rgbToHex(...getColorRgb(data.wezterm.cursor_bg, data.palette))}"221cursor_border = "${rgbToHex(222 ...getColorRgb(data.wezterm.cursor_border, data.palette)223 )}"224cursor_fg = "${rgbToHex(...getColorRgb(data.wezterm.cursor_fg, data.palette))}"225selection_bg = "${rgbToHex(226 ...getColorRgb(data.wezterm.selection_bg, data.palette)227 )}"228selection_fg = "${rgbToHex(229 ...getColorRgb(data.wezterm.selection_fg, data.palette)230 )}"231ansi = [${data.wezterm.ansi.map(232 (item) => `"${rgbToHex(...getColorRgb(item, data.palette))}"`233 )}]234brights = [${data.wezterm.brights.map(235 (item) => `"${rgbToHex(...getColorRgb(item, data.palette))}"`236 )}]237 `;...
rgb_to_hex.test.ts
Source:rgb_to_hex.test.ts
1import { rgbToHex } from './rgb_to_hex';2describe('rgbToHex ', () => {3 describe('validation', () => {4 it('should return an empty string for malformed input', () => {5 expect(rgbToHex('fred')).toEqual('');6 expect(rgbToHex('rgb(fred')).toEqual('');7 expect(rgbToHex('rgb(fred, bob, banana')).toEqual('');8 expect(rgbToHex('rgb(0, 3, 5')).toEqual('');9 expect(rgbToHex('rgba(0, 3, 5')).toEqual('');10 expect(rgbToHex('rgba(0, 3, 5, 99)')).toEqual('');11 });12 });13 describe('rgb()', () => {14 it('should handle rgb() without whitespace', () => {15 expect(rgbToHex('rgb(12,34,56)')).toEqual('#0c2238');16 });17 it('should handle rgb() with whitespace', () => {18 expect(rgbToHex('rgb ( 12 , 34 , 56 )')).toEqual('#0c2238');19 });20 });21 describe('rgba()', () => {22 it('should handle no whitespace', () => {23 expect(rgbToHex('rgba(12,34,56,0.4)')).toEqual('#0c2238');24 });25 it('should handle whitespace', () => {26 expect(rgbToHex('rgba ( 12 , 34 , 56 , 0.4 )')).toEqual('#0c2238');27 });28 it('should handle integer maximum alpha', () => {29 expect(rgbToHex('rgba(12,34,56,1)')).toEqual('#0c2238');30 });31 it('should handle decimal maximum alpha', () => {32 expect(rgbToHex('rgba(12,34,56,1.00000)')).toEqual('#0c2238');33 });34 it('should handle integer zero alpha', () => {35 expect(rgbToHex('rgba(12,34,56,0)')).toEqual('#0c2238');36 });37 it('should handle decimal zero alpha', () => {38 expect(rgbToHex('rgba(12,34,56,0.0000)')).toEqual('#0c2238');39 });40 });...
Using AI Code Generation
1const { openBrowser, goto, rgbToHex, closeBrowser } = require('taiko');2(async () => {3 try {4 await openBrowser();5 await goto("google.com");6 let rgb = await rgbToHex("rgb(255, 255, 255)");7 console.log(rgb);8 } catch (e) {9 console.error(e);10 } finally {11 await closeBrowser();12 }13})();
Using AI Code Generation
1const { rgbToHex } = require('taiko');2console.log(rgbToHex('rgb(0, 0, 0)'));3console.log(rgbToHex('rgba(255, 255, 255, 0.5)'));4> const { rgbToHex } = require('taiko');5> rgbToHex('rgb(0, 0, 0)');6> rgbToHex('rgba(255, 255, 255, 0.5)');7> rgbToHex('rgb(0, 0, 0)');8> rgbToHex('rgba(255, 255, 255, 0.5)');9const { rgbToHex } = require('taiko');
Using AI Code Generation
1const { rgbToHex } = require('taikoColor');2const { hexToRgb } = require('taikoColor');3const { rgbToHsl } = require('taikoColor');4const { hslToRgb } = require('taikoColor');5const { hslToHex } = require('taikoColor');6const { hexToHsl } = require('taikoColor');7console.log(hexToHsl
Using AI Code Generation
1const { rgbToHex } = require('taiko');2console.log(rgbToHex(255, 165, 0));3const taiko = require('taiko');4console.log(taiko.rgbToHex(255, 165, 0));5const { rgbToHex } = require('taiko');6console.log(rgbToHex(255, 165, 0));7const taiko = require('taiko');8console.log(taiko.rgbToHex(255, 165, 0));
Using AI Code Generation
1const { rgbToHex } = require('taiko');2const { toHex } = require('taiko');3const { toRGB } = require('taiko');4const { toRGBA } = require('taiko');5const { rgbaToHex } = require('taiko');6const { toHSL } = require('taiko');7const { toHSLA } = require('taiko');8const { toHSL } = require('taiko');9const { toHSLA } = require('taiko');10const { toHSL } = require('taiko');
Using AI Code Generation
1var taikoColor = require('taikoColor');2var rgb = taikoColor.rgbToHex(100, 100, 100);3console.log(rgb);4var taikoColor = require('taikoColor');5var hex = taikoColor.hexToRgb('#000000');6console.log(hex);7var taikoColor = require('taikoColor');8var hex = taikoColor.hexToRgb('#000000');9console.log(hex);10var taikoColor = require('taikoColor');11var hex = taikoColor.hexToRgb('#000000');12console.log(hex);13var taikoColor = require('taikoColor');14var hex = taikoColor.hexToRgb('#000000');15console.log(hex);16var taikoColor = require('taikoColor');17var hex = taikoColor.hexToRgb('#000000');18console.log(hex);19var taikoColor = require('taikoColor');20var hex = taikoColor.hexToRgb('#000000');21console.log(hex);22var taikoColor = require('taikoColor');23var hex = taikoColor.hexToRgb('#000000');24console.log(hex);25var taikoColor = require('taikoColor');26var hex = taikoColor.hexToRgb('#000000');27console.log(hex);28var taikoColor = require('taikoColor');29var hex = taikoColor.hexToRgb('#000000');30console.log(hex);31var taikoColor = require('taikoColor');32var hex = taikoColor.hexToRgb('#000
Using AI Code Generation
1var { rgbToHex } = require('taiko');2var hex = rgbToHex('rgb(255, 0, 0)');3var { hexToRgb } = require('taiko');4var rgb = hexToRgb('#ff0000');5var { openBrowser, goto, closeBrowser, getAttribute } = require('taiko');6(async () => {7 try {8 await openBrowser();9 await goto("google.com");10 var value = await getAttribute({ id: "hplogo" }, "title");11 } catch (e) {12 console.error(e);13 } finally {14 await closeBrowser();15 }16})();17var { openBrowser, goto, closeBrowser, setAttribute } = require('taiko');18(async () => {19 try {20 await openBrowser();21 await goto("google.com");22 await setAttribute({ id: "hplogo" }, "title", "Google Search");23 var value = await getAttribute({ id: "hplogo" }, "title");24 } catch (e) {25 console.error(e);26 } finally {27 await closeBrowser();28 }29})();30var { openBrowser, goto, closeBrowser, getCSSProperty } = require('taiko');31(async () => {32 try {33 await openBrowser();34 await goto("google.com");35 var value = await getCSSProperty({ id: "hplogo" }, "display");36 } catch (e) {37 console.error(e);38 } finally {39 await closeBrowser();40 }41})();42var { openBrowser, goto, closeBrowser, getComputedLabel } = require('taiko');43(async () => {44 try {45 await openBrowser();46 await goto("google
Using AI Code Generation
1var { rgbToHex } = require('taiko');2var color = rgbToHex("rgb(255, 0, 0)");3console.log(color);4rgbToHex(color)5var { rgbToHex } = require('taiko');6var color = rgbToHex("rgb(255, 0, 0)");7console.log(color);8await click("button", {color: "#ff0000"});9await click("button", {color: "rgb(255, 0, 0)"});10await click("button", {color: "rgba(255, 0, 0, 1)"});
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.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!