How to change the color of a unicode character - Stack Overflow

文章推薦指數: 80 %
投票人數:10人

No. The color is inherent to the character -- there's a LARGE BLUE CIRCLE as well (U+1F535 - 🔵), but no other colors are currently defined ... Home Public Questions Tags Users Collectives ExploreCollectives FindaJob Jobs Companies Teams StackOverflowforTeams –Collaborateandshareknowledgewithaprivategroup. CreateafreeTeam WhatisTeams? Teams CreatefreeTeam CollectivesonStackOverflow Findcentralized,trustedcontentandcollaboratearoundthetechnologiesyouusemost. Learnmore Teams Q&Aforwork Connectandshareknowledgewithinasinglelocationthatisstructuredandeasytosearch. Learnmore Howtochangethecolorofaunicodecharacter AskQuestion Asked 4years,9monthsago Active 3monthsago Viewed 16ktimes 9 2 I'mtryingtogetagreen,cyan,purpleandyellowlargecirclelikethisone:🔴,buttherearen'tanycodesforone.Isthereanywaytochangethecodetochangethecolor? unicode Share Follow askedMar4'17at16:40 AshNelsonAshNelson 10911goldbadge11silverbadge44bronzebadges 5 Colorisgenerallyorthogonaltocharacter.Itismoreaquestionofdisplaydevice. – JohnColeman Mar4'17at16:49 1 Whydoyouneedtouseunicode-characters?Ifyou'redisplayingthisasHTML,can'tyoujustmakethemwithcontainersandCSS?OruseathinglikeFontAwesome,withthefilledcircle? – junkfoodjunkie Mar4'17at16:50 Unicodedefinesglyphs,whichisthecodepointsandtheshapeofthecharacters,notthecolor.Somenewfontsandfontrenderershavesupportforcoloremojibutgenerallyfontsize,color,boldness,slantnesscannotbecontrolledbyUnicode – phuclv Mar4'17at17:01 1 PossibleduplicateofColorintheUnicodestandard? – phuclv Mar4'17at17:01 Thisisausefulresourceforwhenyoucan'tordon'twantto(orcan't)touchthefront-endbutwantsomecolorfulcharacters(e.g.onaheadlessCMS):emojiterra.com – edison23 Dec2'20at7:33 Addacomment  |  3Answers 3 Active Oldest Votes 5 No.Thecolorisinherenttothecharacter--there'saLARGEBLUECIRCLEaswell(U+1F535-🔵),butnoothercolorsarecurrentlydefinedbytheUnicodestandard. Share Follow answeredMar4'17at16:47 user149341user149341 2 eventheLARGEBLUECIRCLEisn'tnecessarilyrenderedincolorfileformat.info/info/unicode/char/1f535/index.htm – phuclv Mar4'17at16:56 4 🔵🔴🟠🟡🟢🟣🟤🟦🟥🟧🟨🟩🟪🟫🛑🔶🔷🔸🔹🔺🔻𝐄𝐭𝐜... – ashleedawg Oct30'20at11:13 Addacomment  |  3 IfusingHTML,then YoucanappendxFE0EtogetthetextversionandcolorthatusingCSS: 🔴 🔴︎ 🔴︎ Share Follow editedSep1at6:38 ctrl-alt-delor 6,81155goldbadges3131silverbadges4949bronzebadges answeredJan28'19at16:24 Alien426Alien426 84288silverbadges1111bronzebadges 2 1 IsawnomentionofHTML/CSS/webinthequestion.DidImisssomething? – ctrl-alt-delor Aug31at19:26 No,youdidnotmissanything. – Alien426 Sep1at6:06 Addacomment  |  2 Unicodeishuge,evenhasKlingon,ithasmorecolorsandevensmileysnowadays... Hereyougo,changethenumberstosearchandfindwhatyouneed... foriinrange(10): ii=int('0x1f7e0',base=16)+i print('{:>15}'.format('[{}:{}]'.format(hex(ii),chr(ii))),end='') ifi%7==6: print() Forcyancircle,trystartingfrom0x1f7dfwithrange1000...Alsonotethatunicodecolorisbesteffort,soe.g.onaKlingonbrowserthingsmaynotdisplayincolour... Also,tofindthecodesofcharactersyouhavee.g.: chars='🔵🔴🟠🟡🟢🟣🟤🟦🟥🟧🟨🟩🟪🟫🛑🔶🔷🔸🔹🔺🔻' fori,cinenumerate(chars): print('[{}:{}]'.format(hex(ord(c)),c),end='') ifi%7==6: print() Gives: [0x1f535:🔵][0x1f534:🔴][0x1f7e0:🟠][0x1f7e1:🟡][0x1f7e2:🟢][0x1f7e3:🟣][0x1f7e4:🟤] [0x1f7e6:🟦][0x1f7e5:🟥][0x1f7e7:🟧][0x1f7e8:🟨][0x1f7e9:🟩][0x1f7ea:🟪][0x1f7eb:🟫] [0x1f6d1:🛑][0x1f536:🔶][0x1f537:🔷][0x1f538:🔸][0x1f539:🔹][0x1f53a:🔺][0x1f53b:🔻] Share Follow editedJun24at19:20 answeredSep21'20at13:33 ntgntg 9,91177goldbadges5454silverbadges7575bronzebadges Addacomment  |  YourAnswer ThanksforcontributingananswertoStackOverflow!Pleasebesuretoanswerthequestion.Providedetailsandshareyourresearch!Butavoid…Askingforhelp,clarification,orrespondingtootheranswers.Makingstatementsbasedonopinion;backthemupwithreferencesorpersonalexperience.Tolearnmore,seeourtipsonwritinggreatanswers. Draftsaved Draftdiscarded Signuporlogin SignupusingGoogle SignupusingFacebook SignupusingEmailandPassword Submit Postasaguest Name Email Required,butnevershown PostYourAnswer Discard Byclicking“PostYourAnswer”,youagreetoourtermsofservice,privacypolicyandcookiepolicy Nottheansweryou'relookingfor?Browseotherquestionstaggedunicodeoraskyourownquestion. TheOverflowBlog Podcast398:Feelinginsecureaboutcode’ssecurity Newdata:Whatdeveloperslookforinfuturejobopportunities FeaturedonMeta Reducingtheweightofourfooter NewresponsiveActivitypage Communityinputneeded:Therulesforcollectivesarticles Related 627 Whatisthebestwaytoremoveaccents(normalize)inaPythonunicodestring? 767 Whatexactlydo"u"and"r"stringflagsdo,andwhatarerawstringliterals? 576 WhydoesmodernPerlavoidUTF-8bydefault? 1099 Whatdoesthe'b'characterdoinfrontofastringliteral? 42 ColorintheUnicodestandard? 1410 UnicodeEncodeError:'ascii'codeccan'tencodecharacteru'\xa0'inposition20:ordinalnotinrange(128) 1392 WhyisexecutingJavacodeincommentswithcertainUnicodecharactersallowed? 565 Whyareemojicharacterslike👩‍👩‍👧‍👦treatedsostrangelyinSwiftstrings? HotNetworkQuestions WhatteeniestlonechangewouldhaveactualizedtranscontinentalHighSpeedRailintheUSA? Howisthis.mp4file596523hourslong? WhydoesaBoeing747-8takemorerunwaylengthtotakeoff,comparedtoanAirbusA380? Howtomodelanandroidface(clearlydividedparts)? WhywasPicardCaptainoftheStargazerfor22years? “Letforeach𝑖”vs.“Foreach𝑖let” Whatdoes"teamsarelopsided"mean? AfantasynovelunderLondon Whyisasegmentationfaultnotrecoverable? CanIconverta1x9speedbicycletosinglespeedbyputting9identicalcogsintocassette? Extremedropsinharddiskperformance DoesMisleadautomaticallyhidethespellcaster? PSEAdventCalendar2021(Day7):Don'tforgetthelyrics! Forspellsthatlastseveralrounds,doIrollthediceonceandkeepthesamedamageeverytime,ordoIrollthediceagaineachtime? CanyoucalculatethemeanofsomeMIPvariablesusinglinearconstraints? HowdoIexplainthedistributivityofmultiplicationtoastudentwithoutusingtheanalogyofareas? Istheword"samsara"composedofsimplerconceptsetymologicallyorotherwise? Couldmaking`.bash_logout``.bashrc``.profile`600rendermyOSunusable? WhydoIhearhigherharmonics,whenthestringsaren'tfreetovibrate? CantheSchrodingerequationbesolvedfordeuterium? HowdoesthisWhatsAppscamwork? Listallmembersbyzipcodeorcity Helpmefindthetitleofasci-fiapocalypticmoviefollowingabrother-sisterduo,butthesisterisdifferentsomehow Explanationsforthreecluesinacrypticcrossword morehotquestions Questionfeed SubscribetoRSS Questionfeed TosubscribetothisRSSfeed,copyandpastethisURLintoyourRSSreader. Yourprivacy Byclicking“Acceptallcookies”,youagreeStackExchangecanstorecookiesonyourdeviceanddiscloseinformationinaccordancewithourCookiePolicy. Acceptallcookies Customizesettings  



請為這篇文章評分?