[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-0-en-105":3,"doc-seo-389829-105":59,"doc-detail-389829-en":131,"doc-similar-389829":162},{"code":4,"msg":5,"data":6},0,"success",[7,13,18,23,28,33,38,43,48,51,55],{"id":8,"doc_module":4,"doc_module_name":9,"category_name":10,"show_sort_weight":11,"slug":12},1,"Document","Story & Novel",90,"story-novel",{"id":14,"doc_module":4,"doc_module_name":9,"category_name":15,"show_sort_weight":16,"slug":17},2,"Literature",80,"literature",{"id":19,"doc_module":4,"doc_module_name":9,"category_name":20,"show_sort_weight":21,"slug":22},4,"Exam",70,"exam",{"id":24,"doc_module":4,"doc_module_name":9,"category_name":25,"show_sort_weight":26,"slug":27},5,"Comic",60,"comic",{"id":29,"doc_module":4,"doc_module_name":9,"category_name":30,"show_sort_weight":31,"slug":32},6,"Technology",50,"technology",{"id":34,"doc_module":4,"doc_module_name":9,"category_name":35,"show_sort_weight":36,"slug":37},7,"Healthcare",40,"healthcare",{"id":39,"doc_module":4,"doc_module_name":9,"category_name":40,"show_sort_weight":41,"slug":42},8,"Research & Report",30,"research-report",{"id":44,"doc_module":4,"doc_module_name":9,"category_name":45,"show_sort_weight":46,"slug":47},9,"Religion & Spirituality",20,"religion-spirituality",{"id":46,"doc_module":4,"doc_module_name":9,"category_name":49,"show_sort_weight":46,"slug":50},"World Cup","world-cup",{"id":52,"doc_module":4,"doc_module_name":9,"category_name":53,"show_sort_weight":52,"slug":54},10,"Lifestyle","lifestyle",{"id":56,"doc_module":4,"doc_module_name":9,"category_name":57,"show_sort_weight":24,"slug":58},19,"General","general",{"code":4,"msg":60,"data":61},"ok",{"site_id":62,"language":63,"slug":64,"title":65,"keywords":66,"description":67,"schema_data":68,"social_meta":124,"head_meta":126,"extra_data":128,"updated_unix":130},105,"en","r-color-cheatsheet-color-palette-and-hex-color-usage-guide","R color cheatsheet - Color palette and hex color usage guide","","A practical R color cheatsheet explaining how hexadecimal color codes work (e.g., #rrggbb and optional alpha #rrggbbaa) and how to interpret common values and named colors. It summarizes R’s built-in color names, color model conversions among RGB, HSV, and HCL, and how to generate RGB output with col2rgb. The guide covers palette selection in grDevices, RColorBrewer, and the colorspace package, plus how to define palettes and apply hex colors to plots for discrete and continuous variables.",{"@graph":69,"@context":123},[70,84,106],{"@type":71,"itemListElement":72},"BreadcrumbList",[73,77,79,82],{"item":74,"name":75,"@type":76,"position":8},"https://docshare.wps.com","Home","ListItem",{"item":78,"name":9,"@type":76,"position":14},"https://docshare.wps.com/document/",{"item":80,"name":30,"@type":76,"position":81},"https://docshare.wps.com/document/technology/",3,{"item":83,"name":65,"@type":76,"position":19},"https://docshare.wps.com/document/r-color-cheatsheet-color-palette-and-hex-color-usage-guide/389829/",{"url":83,"name":65,"@type":85,"image":86,"author":91,"headline":65,"publisher":94,"fileFormat":97,"inLanguage":63,"description":67,"dateModified":98,"datePublished":99,"encodingFormat":97,"isAccessibleForFree":100,"interactionStatistic":101},"DigitalDocument",{"url":87,"@type":88,"width":89,"height":90},"https://docshare.wps.com/thumbnails/r-color-cheatsheet-color-palette-and-hex-color-usage-guide/389829.png","ImageObject",300,407,{"name":92,"@type":93},"Quinn Holloway","Person",{"url":74,"name":95,"@type":96},"DocShare","Organization","application/pdf","2026-11-30","2026-09-25",true,{"@type":102,"interactionType":103,"userInteractionCount":105},"InteractionCounter",{"@type":104},"ViewAction",21,{"@type":107,"mainEntity":108},"FAQPage",[109,115,119],{"name":110,"@type":111,"acceptedAnswer":112},"How does R represent colors using hexadecimal codes?","Question",{"text":113,"@type":114},"R uses hexadecimal #rrggbb, where red, green, and blue are each two characters. Transparency can be added at the end as #rrggbbaa.","Answer",{"name":116,"@type":111,"acceptedAnswer":117},"What are RGB, HSV, and HCL, and how does R use them?",{"text":118,"@type":114},"RGB describes red, green, and blue intensities; HSV uses hue, saturation, and value; HCL uses hue, chroma, and luminance. R can translate between these models and supports an optional alpha parameter for transparency.",{"name":120,"@type":111,"acceptedAnswer":121},"Which R packages can generate color palettes, and what do they offer?",{"text":122,"@type":114},"grDevices and colorRamps provide built-in palette functions. RColorBrewer offers brewer.pal for selecting palettes by name, while colorspace provides perceptually based palettes (e.g., rainbow_hcl, diverge_hcl, sequential_hcl) that are customizable.","https://schema.org",{"og:url":83,"og:type":125,"og:title":65,"og:site_name":95,"og:description":67},"article",{"robots":127,"canonical":83},"index,follow",{"doc_id":129,"site_id":62},389829,1791294350,{"code":4,"msg":5,"data":132},{"doc_id":129,"user_id":133,"nickname":92,"user_avatar":134,"doc_module":4,"category_id":29,"category_name":30,"doc_title":65,"doc_description":67,"doc_content":135,"file_id":136,"file_url":137,"file_type":138,"file_size":139,"view_count":105,"is_deleted":4,"is_public":8,"is_downloadable":8,"audit_status":8,"page_count":19,"language":140,"language_code":63,"site_id":62,"html_lang":63,"table_of_contents":141,"faqs":142,"seo_title":143,"seo_description":67,"update_tm":144,"read_time":52,"preview_page_count":19,"preview_urls":145},2336474466712,"https://ap-avatar.wpscdn.com/davatar_a8503ba1806abce46bf441b54a3ca4cd","R color cheatsheet  \nFinding a good color scheme for presenting data can be challenging. This color cheatsheet will help!  \nR uses hexadecimal to represent colors  \nHexadecimal is a base-16 number system used to describe color. Red, green, and blue are each represented by two characters (\\#rrggbb) . Each character has 16 possible symbols: 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E, F:  \n“00” can be interpreted as 0.0 and “FF” as 1.0  \ni.e., red= \\#FF0000 , black=\\#000000, white = \\#FFFFFF  \nTwo additional characters (with the same scale) can be added to the end to describe transparency (\\#rrggbbaa)  \nR has 657 built in color names  \nTo see a list of names:  \ncolors()  \nThese colors are displayed on P. 3.  \nExample:  \npeachpuff4  \nR translates various color models to hex, e.g.:  \n• RGB (red, green, blue): The default intensity scale in R ranges from 0-1; but another commonly used scale is 0- 255. This is obtained in R using maxColorValue=255 . alpha is an optional argument for transparency, with the same intensity scale.  \nrgb(r, g, b, maxColorValue=255, alpha=255)  \n• HSV (hue, saturation, value): values range from 0-1, with optional alpha argument  \nhsv(h, s, v, alpha)  \n• HCL (hue, chroma, luminance): hue describes the color and ranges from 0-360; 0 = red, 120 = green, blue = 240, etc. Range of chroma and luminance depend on hue and eachother  \nhcl(h, c, l, alpha)  \nPage 1, Me lan ie Frazier  \nA few notes on HSV/HLC  \nHSV is a better model for how humans perceive color. HCL can be thought of as a perceptually based version of the HSV model   blah blah blah…  \nWithout delving into color theory: color schemes based on HSV/HLC models generally just look good.  \nR can translate colors to rgb (this is handy for matching colors in other programs)  \ncol2rgb(c(“\\#FF0000”,“blue”))  \nR Color Palettes  \nThis is for all of you who don’t know anything about color theory, and don’t care but want some nice colors on your map or figure   NOW!  \nTIP: When it comes to selecting a color palette, DO NOT try to handpick individual colors! You will waste a lot of time and the result will probably not be all that great. R has some good packages for color palettes. Here are some of the options  \nPackages: grDevices and colorRamps  \ngrDevices comes with the base installation and colorRamps must be installed. Each palette’s function has an argument for the number of colors and transparency (alpha):  \ngrDevices palettes  \ncm.colors topo.colors terrain.colors heat.colors rainbow  \nsee P. 4 for options  \nheat.colors(4, alpha=1)  \n> \\#FF0000FF\" \"\\#FF8000FF\" \"\\#FFFF00FF\" \"\\#FFFF80FF“  \nFor the rainbow palette you can also select start/end color (red = 0, yellow = 1/6, green = 2/6, cyan = 3/6, blue = 4/6 and magenta = 5/6) and saturation (s) and value (v):  \nrainbow(n, s = 1, v = 1, start = 0, end = max(1, n-1)/n, alpha = 1)  \nPackage: RcolorBrewer  \nThis function has an argument for the number of colors and the color palette (see P. 4 for options) .  \nbrewer.pal(4,“Set3”)  \n> \"\\#8DD3C7\" \"\\#FFFFB3\" \"\\#BEBADA\" \"\\#FB8072“  \n\n| \u003Cbr>To view colorbrewer palettes in R: display. brewer.all(5)\u003Cbr>There is also a very nice interactive viewer:\u003Cbr>[http://colorbrewer2.org/](http://colorbrewer2.org/) |  |\n| --- | --- |\n| \\#\\# My Recommendation \\#\\# |  |\n| Package: colorspace\u003Cbr>These color palettes are based on HCL and HSV color models. The results can be very aesthetically pleasing. There are some default palettes:\u003Cbr>rainbow_hcl(4) | \u003Cbr>colorspace default palettes\u003Cbr>diverge_hcl\u003Cbr>diverge_hsl terrain_hcl sequential_hcl rainbow_hcl |\n| \"\\#E495A5\" \"\\#ABB065\" \"\\#39BEB1\" \"\\#ACA4E2“\u003Cbr>However, all palettes are fully customizable:\u003Cbr>diverge_hcl(7, h = c(246, 40), c = 96, l = c(65, 90))\u003Cbr>Choosing the values would be daunting. But there are some recommended palettes in the colorspace documentation. There is also an interactive tool that can be used to obtain a customized palette. To start the tool:\u003Cbr>pal \u003C-choose_palette() |  |\n\nPage 2, Me lan ie Frazier  \nR color cheatsheet  \nOv","cbCaifIWfVLRMucm","https://ap.wps.com/l/cbCaifIWfVLRMucm","pdf",1430989,"English","# Hex color codes and interpretation\n## RGB, HSV, and HCL color models\n## Converting and extracting colors in R\n# Built-in palettes and palette packages\n## grDevices and colorRamps\n## RColorBrewer\n## colorspace palette tools\n# Applying palettes in plots\n## Discrete variables\n## Continuous variables","[{\"question\":\"How does R represent colors using hexadecimal codes?\",\"answer\":\"R uses hexadecimal #rrggbb, where red, green, and blue are each two characters. Transparency can be added at the end as #rrggbbaa.\"},{\"question\":\"What are RGB, HSV, and HCL, and how does R use them?\",\"answer\":\"RGB describes red, green, and blue intensities; HSV uses hue, saturation, and value; HCL uses hue, chroma, and luminance. R can translate between these models and supports an optional alpha parameter for transparency.\"},{\"question\":\"Which R packages can generate color palettes, and what do they offer?\",\"answer\":\"grDevices and colorRamps provide built-in palette functions. RColorBrewer offers brewer.pal for selecting palettes by name, while colorspace provides perceptually based palettes (e.g., rainbow_hcl, diverge_hcl, sequential_hcl) that are customizable.\"}]","R color cheatsheet - Color palette and hex color usage guide | PDF",1790327882,[146,150,154,158],{"page_no":8,"url":147,"width":148,"height":149},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-16/a7eb9dfef2f717dc7329b5f8b5797944.webp",983,1272,{"page_no":14,"url":151,"width":152,"height":153},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-16/5b6e23e0e60ad100fa3a7cef5995f2b4.webp",982,1270,{"page_no":81,"url":155,"width":156,"height":157},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-16/f1f876e0dcf4fae59d849723d5e5e805.webp",981,1269,{"page_no":19,"url":159,"width":160,"height":161},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-16/e7914de2d0bf567160822aceb665fa69.webp",980,1268,{"list":163,"token":66},[164,170,176,182,189,195,202,208,214,221],{"doc_id":165,"doc_title":166,"file_type":138,"home_preview_img_url":167,"slug":168,"view_count":81,"category_name":30,"create_tm":169},734513,"HTML color codes - Quick reference","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230032227404/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796220719&Signature=q2THi8gmNv%2BZcZsJ0aHPInmJLCQ%3D","html-color-codes-quick-reference",1795399629,{"doc_id":171,"doc_title":172,"file_type":138,"home_preview_img_url":173,"slug":174,"view_count":81,"category_name":30,"create_tm":175},734516,"HTML Color Code Chart - Table of Color Names with Hex and RGB Values","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230032227507/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796220719&Signature=Drg9QJxdVspi1e73c5%2BZDaWg82I%3D","html-color-code-chart-table-of-color-names-with-hex-and-rgb-values",1795399635,{"doc_id":177,"doc_title":178,"file_type":138,"home_preview_img_url":179,"slug":180,"view_count":81,"category_name":30,"create_tm":181},734514,"Hex Color Codes - Introduction and Guide","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230032227347/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796220719&Signature=bMDiXf8zLrUuXP%2BVL5ejuF5pPNg%3D","hex-color-codes-introduction-and-guide",1795399630,{"doc_id":183,"doc_title":184,"file_type":138,"home_preview_img_url":185,"slug":186,"view_count":187,"category_name":30,"create_tm":188},412272,"Photoshop - How to Use Color Palettes","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229921474165/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796220719&Signature=nQMG1n%2BOdzxLDDArldb7F4p8bbA%3D","photoshop-how-to-use-color-palettes",15,1790591054,{"doc_id":190,"doc_title":191,"file_type":138,"home_preview_img_url":192,"slug":193,"view_count":81,"category_name":30,"create_tm":194},734523,"Color Codes Matching Chart - HTML","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230032227768/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796220719&Signature=OBggms7hFN8qAyO31lZ%2FIR9GMfY%3D","color-codes-matching-chart-html",1795399667,{"doc_id":196,"doc_title":197,"file_type":138,"home_preview_img_url":198,"slug":199,"view_count":200,"category_name":30,"create_tm":201},510641,"Sherwin-Williams Color Color Codes - Color Name, RGB, HEX Values","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229935361126/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796220719&Signature=9DWzutOKLG4RRkbolQ2yaeb16Ek%3D","sherwin-williams-color-color-codes-color-name-rgb-hex-values",24,1791243550,{"doc_id":203,"doc_title":204,"file_type":138,"home_preview_img_url":205,"slug":206,"view_count":24,"category_name":30,"create_tm":207},692628,"PANTONE Coated RGB Color Chart","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230004142573/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796220719&Signature=m8e64PdbxEaat0vIMGoopf0yMb0%3D","pantone-coated-rgb-color-chart",1794230870,{"doc_id":209,"doc_title":210,"file_type":138,"home_preview_img_url":211,"slug":212,"view_count":24,"category_name":30,"create_tm":213},704708,"Color Tuning with Lutron Controls - Application Note #579 - Revision G","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230014288607/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796220719&Signature=g0DJDgUX3fhYDuGpV3nN48o7py0%3D","color-tuning-with-lutron-controls-application-note-579-revision-g",1794620427,{"doc_id":215,"doc_title":216,"file_type":138,"home_preview_img_url":217,"slug":218,"view_count":219,"category_name":30,"create_tm":220},148301,"081_BooksByNumber_RickAndMorty_ColoringWorld - RGB配色表","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229869039902/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796220719&Signature=kQozTAHtQO5zv8%2BDiWvXzuopIrA%3D","081_booksbynumber_rickandmorty_coloringworld-rgb-color-palette",26,1787778423,{"doc_id":222,"doc_title":223,"file_type":138,"home_preview_img_url":224,"slug":225,"view_count":29,"category_name":30,"create_tm":226},680699,"How to Spice Up Gantt Charts With Intelligent Colors - Conclusion & Additional Resources","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229998010803/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796220719&Signature=6X%2Fe08MeOg0j8DbYIu7BbPNvEdY%3D","how-to-spice-up-gantt-charts-with-intelligent-colors-conclusion-additional-resources",1793919655]