# col2hex2col 0.5.3 (CRAN)

Convert Between Color Names and Hex Codes

[Record of 0.5.3](/cran/col2hex2col/v/0.5.3.md) | Compare: [With 0.3.1](/cran/col2hex2col/compare/0.3.1...0.5.3.md), [With another package](/compare/col2hex2col.md#add), [Downloads](/downloads/compare/col2hex2col.md#add) | [Licences](/cran/col2hex2col/licences.md) | [SBOM](/cran/col2hex2col/sbom.md)

Install from CRAN: `install.packages("col2hex2col")`

Also from:

- r2u (Ubuntu binaries): `sudo apt install r-cran-col2hex2col` _Listed from recorded download activity on this channel, not from a live index, so read it as last known. Bioconductor packages are named r-bioc-<name> there._
- Fedora COPR (iucar/cran): `sudo dnf install R-CRAN-col2hex2col` _A rebuild of what CRAN lists, so it can lag CRAN by a rebuild._
- autoCRAN (openSUSE): `sudo zypper install R-col2hex2col` _Listed from recorded download activity on this channel, not from a live index, so read it as last known._

- CRAN checks: All OK (13 platforms)
- CRAN 30-day downloads: 339 (up 32.4% on the 30 days before, the better direction)
- Dependent packages: 0 (none suggest it)
- Test coverage: 86% (of lines run by tests)
- Advisories: None known

## About

[Method](/about/licenses.md)

Provides simple functions to convert between color names and hexadecimal color codes using an extensive database of over 32,000 colors. Includes all 657 R built-in colors plus the comprehensive color-names database. The package supports bidirectional conversion with backward compatibility, prioritizing R colors when available.

- Maintainer: Antti Rask
- Licence: [MIT + file LICENSE](/licences/MIT.md)
- Latest release: 18 Feb 2026
- First release: 21 Jan 2026

- [CRAN page](https://cran.r-project.org/package=col2hex2col)
- [Source repository](https://github.com/anttirask/col2hex2col)
- [Issues](https://github.com/AnttiRask/col2hex2col/issues)
- [Source of every release](https://github.com/cran/col2hex2col)

[Compare with another package](/compare/col2hex2col.md#add)

**More details**

- Releases: 2
- Needs compilation: No
- Needs R: >= 3.5.0
- Config/testthat/edition: 3
- RoxygenNote: 7.3.3

**Subjects (2) [Method](/about/subjects.md#found)**

- [Color palettes and spaces](/topics/subjects/color-palettes.md)
- [String manipulation](/topics/subjects/string-manipulation.md)

**Cite**

#### Package

Run in R for the authors' preferred citation:

`citation("col2hex2col")`

APA: Rask, A., & Cohen, Y. (2026). col2hex2col: Convert Between Color Names and Hex Codes (Version 0.5.3) [Computer software]. https://doi.org/10.32614/CRAN.package.col2hex2col

BibTeX:

```
@Manual{col2hex2col,
  title  = {col2hex2col: Convert Between Color Names and Hex Codes},
  author = {Rask, Antti and Cohen, Yann},
  year   = {2026},
  note   = {R package version 0.5.3},
  doi    = {10.32614/CRAN.package.col2hex2col},
  url    = {https://CRAN.R-project.org/package=col2hex2col}
}
```

This package has no citation file, so `citation()` returns this entry built from `DESCRIPTION`.

#### R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA: Balamuta, J. J. (2026). R Observatory: Metrics for col2hex2col version 0.5.3 [Data set]. HJJB, LLC. Data release v2026-10-28. https://doi.org/10.5281/zenodo.21843040

BibTeX:

```
@misc{robservatorycol2hex2col,
  author    = {Balamuta, James Joseph},
  title     = {{R} {Observatory}: Metrics for {col2hex2col} version 0.5.3},
  year      = {2026},
  publisher = {HJJB, LLC},
  doi       = {10.5281/zenodo.21843040},
  url       = {https://r-observatory.thecoatlessprofessor.com/packages/col2hex2col},
  note      = {Data set. Data release v2026-10-28}
}
```

From data release v2026-10-28, which the citation names so these numbers can be found later.

## Health

[Method](/about/checks-health.md)

All 13 check platforms pass.

13 CRAN platforms: 13 OK.

Platforms now:

- r-devel-linux-x86_64-debian-clang: OK
- r-devel-linux-x86_64-debian-gcc: OK
- r-devel-linux-x86_64-fedora-clang: OK
- r-devel-linux-x86_64-fedora-gcc: OK
- r-devel-windows-x86_64: OK
- r-oldrel-macos-arm64: OK
- r-oldrel-macos-x86_64: OK
- r-oldrel-windows-x86_64: OK
- r-patched-linux-x86_64: OK
- r-release-linux-x86_64: OK
- r-release-macos-arm64: OK
- r-release-macos-x86_64: OK
- r-release-windows-x86_64: OK

#### Over time

No change since 5 Aug 2026

**As a list (5)**

| Changed | Worst status | OK | Notes | Warnings | Errors |
| --- | --- | ---: | ---: | ---: | ---: |
| 5 Aug 2026 | OK | 13 | 0 | 0 | 0 |
| 1 Aug 2026 | Note | 12 | 1 | 0 | 0 |
| 18 Jul 2026 | OK | 13 | 0 | 0 | 0 |
| 16 Jul 2026 | Error | 12 | 0 | 0 | 1 |
| 10 Mar 2026 | OK | 14 | 0 | 0 | 0 |

Since March 2026

[Check results on CRAN](https://cran.r-project.org/web/checks/check_results_col2hex2col.html)

## Downloads

[Method](/about/downloads.md)

- Downloads in the last 30 days: 356 (up 27.1% on the 30 days before, the better direction. It is the sum of 3 channels: CRAN, r2u and autoCRAN.)

CRAN alone: rank among CRAN packages, last 30 days: 11,136 of 26,530.

| Channel | Downloads in the last 30 days | In the total | Rank in that channel | Change |
| --- | ---: | --- | --- | --- |
| CRAN | 339 | yes | 11,136 of 26,530 | up 32.4% on the 30 days before, the better direction |
| r2u | 12 | yes | 6,028 of 30,526 | up 140% on the 30 days before, the better direction |
| autoCRAN | 5 | yes | 10,893 of 29,212 | down 73.7% on the 30 days before, the worse direction |

Other windows: [Last 90 days](/cran/col2hex2col.md?win=90d#downloads), [Last 365 days](/cran/col2hex2col.md?win=365d#downloads), [All time](/cran/col2hex2col.md?win=all#downloads).

To leave channels out of the total, name them in the address, joined by dots: `?off=r2u.autocran`.

#### Over time

Downloads over time, the last 8 whole months:

| Month | CRAN | r2u | autoCRAN | Sum |
| --- | ---: | ---: | ---: | ---: |
| Feb 2026 | 278 | 18 | no figure | 296 |
| Mar 2026 | 219 | 5 | no figure | 224 |
| Apr 2026 | 185 | 12 | no figure | 197 |
| May 2026 | 144 | 10 | no figure | 154 |
| Jun 2026 | 196 | no figure | no figure | 196 |
| Jul 2026 | 212 | 14 | 28 | 254 |
| Aug 2026 | 174 | 5 | 35 | 214 |
| Sep 2026 | 272 | no figure | 12 | 284 |

First day on record: CRAN 21 Jan 2026, r2u 22 Jan 2026, autoCRAN 29 Jun 2026.

Every channel here counts downloads, so the channels can be stacked and summed for one period. Each channel counts in its own way and covers a different span of years, so read a sum as a rough total, and read a rise where a channel begins as that channel starting, not as growth.

Weeks start on Monday. A first or last week or month that the channel does not cover in full is left out, so every point is a whole period.

Days with no record add nothing to their week or month. For a little-used package that is usually a day with no downloads, but it can also be a gap in collection.

[Compare downloads](/downloads/compare/col2hex2col.md#add)

## Dependencies

[Method](/about/reverse-dependencies.md)

- Needs: 0
- Dependent packages: 0
- Suggested by: 0

**Optional extras (4)**

- [cli](/cran/cli.md)
- [farver](/cran/farver.md)
- [gt](/cran/gt.md)
- [testthat](/cran/testthat.md)

## Code

[Method](/about/code-metrics.md)

Selected function: `fallback_nearest_hex`

- Kind: Internal R function
- File: R/fallback_nearest_hex.R, line 3
- Lines: 57
- Complexity: 8
- Covered by tests: 68%

Called by 1: [`hex_to_color`](/cran/col2hex2col.md?fn=hex_to_color&view=focus#code) (94% of lines run by tests)

Calls 1: [`get_color_data`](/cran/col2hex2col.md?fn=get_color_data&view=focus#code) (100% of lines run by tests)

Paths: 2 steps each way.

Called by 1:

- [`hex_to_color`](/cran/col2hex2col.md?fn=hex_to_color&view=focus#code)

Calls 1:

- [`get_color_data`](/cran/col2hex2col.md?fn=get_color_data&view=focus#code)

The open file in the files map is `R/fallback_nearest_hex.R`.

- Functions: 1
- Lines: 57
- Calls that stay inside it: 0
- Calls to other files: 1, to 1
- Calls from other files: 1, from 1

It calls: `R/color_data.R` (1 call)

Called from: `R/color_conversion.R` (1 call)

| Function in fallback_nearest_hex.R | Calls in other files |
| --- | --- |
| [`fallback_nearest_hex`](/cran/col2hex2col.md?fn=fallback_nearest_hex&view=focus#code) selected | [`get_color_data`](/cran/col2hex2col.md?fn=get_color_data&view=focus#code) |


1 file with no calls to or from another: `R/create_color_table.R`.

The whole package has 5 function names in 4 files and 2 calls between them. Most calls between files: `R/color_data.R` and `R/fallback_nearest_hex.R` (1 call), `R/color_conversion.R` and `R/fallback_nearest_hex.R` (1 call).

Graph: the whole call graph has 3 function names that take part in a call and 2 calls between them, set out in 3 layers with callers before what they call. 2 function names have no calls and are left out. Called by the most functions: `get_color_data` (1), `fallback_nearest_hex` (1), `hex_to_color` (0). Calling the most functions: `fallback_nearest_hex` (1), `hex_to_color` (1), `get_color_data` (0).

Most connected functions: [`fallback_nearest_hex`](/cran/col2hex2col.md?fn=fallback_nearest_hex&view=focus#code) 2, [`get_color_data`](/cran/col2hex2col.md?fn=get_color_data&view=focus#code) 1, [`hex_to_color`](/cran/col2hex2col.md?fn=hex_to_color&view=focus#code) 1

To select another function, add ?fn=NAME to this address.

The call graph also has an address of its own: /cran/col2hex2col/graph.md?fn=fallback_nearest_hex&view=focus

- Functions: 5
- Public exports: 4
- Lines of R code: 530
- Median complexity: 8

**Functions (5)**

| Function (sorted, low to high) | Kind | File | Lines | Complexity | Covered |
| --- | --- | --- | ---: | ---: | ---: |
| [`color_to_hex`](/cran/col2hex2col.md?fn=color_to_hex#code) | Public | R/color_conversion.R | 27 | 4 | 100% |
| [`create_color_table`](/cran/col2hex2col.md?fn=create_color_table#code) | Public | R/create_color_table.R | 63 | 9 | 85% |
| [`get_color_data`](/cran/col2hex2col.md?fn=get_color_data#code) | Public | R/color_data.R | 26 | 3 | 100% |
| [`hex_to_color`](/cran/col2hex2col.md?fn=hex_to_color#code) | Public | R/color_conversion.R | 61 | 8 | 94% |
| [`fallback_nearest_hex`](/cran/col2hex2col.md?fn=fallback_nearest_hex#code) | Internal | R/fallback_nearest_hex.R | 57 | 8 | 68% |

This page lists 1 to 5 of 5 functions.

**Size and composition**

#### Lines by kind (1,301)

| Kind | Lines | Share |
| --- | ---: | ---: |
| R code | 530 | 41% |
| Tests | 421 | 32% |
| Documentation | 350 | 27% |

#### Lines by language

| Language | Lines | Share |
| --- | ---: | ---: |
| R | 951 | 73% |
| Rd | 350 | 27% |

Languages are counted from file extensions.

- Files: 25
- R functions: 5

**Complexity**

- Median: 8
- Mean: 6.4
- Highest: 9
- Median lines per function: 57

_About complexity: Cyclomatic complexity counts the independent paths through a function: 1 is a straight line, higher is harder to test. R functions only._

**Call graph figures**

- R functions: 5
- Calls: 2
- Unconnected: 2
- Groups: 1

**Growth (2 releases)**

Total lines by release: from 1,141 (on 21 Jan 2026) to 1,301 (on 18 Feb 2026). The lowest is 1,141 and the highest is 1,301.

**Release changes**

[Both releases side by side](/cran/col2hex2col/compare/0.3.1...0.5.3.md)

**0.3.1 to 0.5.3**, 21 Jan 2026 to 18 Feb 2026

- Files changed: 20
- Lines added: 345
- Lines deleted: 83
- Exports: No change

**Changed measures (18)**

| Measure | Subject | Before | After |
| --- | --- | ---: | ---: |
| Internal functions | Structure | 0 | 1 |
| Total lines | Structure | 1,141 | 1,301 |
| Lines of R code | Structure | 413 | 530 |
| Lines of tests | Structure | 400 | 421 |
| R functions | Languages | 4 | 5 |
| Lines of documentation | Documentation | 328 | 350 |
| Test cases | Testing | 50 | 51 |
| Test lines per line of code | Testing | 0.97 | 0.79 |
| Mean complexity | Complexity | 3.5 | 6.4 |
| Highest complexity | Complexity | 5 | 9 |
| Median complexity | Complexity | 4 | 8 |
| Lines per function (mean) | Complexity | 33.75 | 46.8 |
| Functions (nodes) | Call graph | 4 | 5 |
| Call edges | Call graph | 0 | 2 |
| Most connections on one function | Call graph | 0 | 2 |
| Mean connections | Call graph | 0 | 0.8 |
| Functions with no connections | Call graph | 4 | 2 |
| Separate groups | Call graph | 0 | 1 |

**Most changed files (12 of 20)**

| File | Lines added | Lines deleted |
| --- | ---: | ---: |
| `NEWS.md` | 64 | 0 |
| `README.md` | 45 | 16 |
| `R/fallback_nearest_hex.R` | 59 | 0 |
| `R/color_conversion.R` | 45 | 5 |
| `R/create_color_table.R` | 19 | 20 |
| `MD5` | 19 | 15 |
| `R/color_data.R` | 23 | 4 |
| `man/hex_to_color.Rd` | 17 | 4 |
| `DESCRIPTION` | 12 | 7 |
| `tests/testthat/test-fallback_nearest_hex.R` | 17 | 0 |
| `man/col2hex2col-package.Rd` | 8 | 1 |
| `tests/testthat/test-get_color_data.R` | 6 | 3 |

Datasets: 2 changed.

## Tests

[Method](/about/coverage.md)

The tests ran and coverage was measured.

- Lines run by tests: 85.9%
- Expressions run by tests: 89%
- Test cases: 51
- Exports named in tests: 100%

**Coverage by file (4)**

4 files measured, least covered first.

| File | Lines | Run by tests | Not run | Coverage |
|---|---:|---:|---:|---:|
| `R/fallback_nearest_hex.R`, 1 function | 37 | 25 | 12 | 68% |
| `R/create_color_table.R`, 1 function | 34 | 29 | 5 | 85% |
| `R/color_conversion.R`, 2 functions | 48 | 46 | 2 | 96% |
| `R/color_data.R`, 1 function | 16 | 16 | 0 | 100% |

**Coverage run**

- Lines counted: 135
- Lines the tests ran: 116
- Tests passed: Yes
- Measured with: covr 3.6.5 on R 4.6.1

**Test suite**

- Has tests: Yes
- Test frameworks: testthat
- Test cases: 51
- Lines of tests: 421
- Test lines per line of code: 0.79

## Documentation

[Method](/about/code-metrics.md)

- Exports documented: 100%
- Arguments documented: 100%
- Return value documented: 100%
- Help pages with examples: 80%
- Examples run in checks: 100%

**Other documentation**

- README: Yes, 455 words
- Release notes file: Yes
- Help pages: 5
- Lines of documentation: 350

## Datasets

[Method](/about/objects.md)

2 datasets, 0 can be loaded by name

| Dataset | Size |
| --- | --- |
| [colornames_hex_to_name_vector](/cran/col2hex2col/data/colornames_hex_to_name_vector.md) | length 32,189 |
| [colornames_name_to_hex_vector](/cran/col2hex2col/data/colornames_name_to_hex_vector.md) | length 32,491 |

## People

[Method](/about/author-identity.md)

- [Antti Rask](/people/Antti+Rask.md): Maintainer since 0.3.1 (2026), author, copyright holder
- [Yann Cohen](/people/Yann+Cohen.md): Contributor

## Repository

[Method](/about/repo-signals.md#figures)

[AnttiRask](/repos/AnttiRask.md) / [col2hex2col](https://github.com/anttirask/col2hex2col) on github.com

- Stars: 3 (no change on 30 days ago)
- Forks: 0
- Open issues: 1
- Last commit: 1 Jun 2026

**Activity**

- Commits: 69
- Open pull requests: 0
- Tagged releases: 11
- Latest tagged release: v0.5.3, 17 Feb 2026
- Issues closed in: –
- Pull requests closed in: 21 days (median)
- Pull requests merged: 17%
- Created: 29 Dec 2025
- Licence file reads as: –

**Development practices (6)**

| Kind | Found |
| --- | --- |
| Continuous integration | GitHub Actions, R CMD check workflow The `R CMD check` workflow runs on Linux, macOS and Windows, and on R-devel |
| Docs source | pkgdown GitHub Pages site last deployed 2026-03-14 The repository has a site deploy workflow |
| Reproducibility and dev environment | data-raw/ |

[Across AnttiRask](/repos/AnttiRask.md#practices)

## AI tools

[Method](/about/ai-tools.md)

#### Tools

| Tool | First seen | Found | Commits crediting it |
| --- | --- | --- | ---: |
| **Claude Code** | 29 Dec 2025 | Seen in the repository: CLAUDE.md. Named in .Rbuildignore: .claude, CLAUDE.md. Named in .gitignore: .claude | at least 38 |

#### Models

| Model | Context window | Commits | First commit | Last commit | Credit lines of |
| --- | --- | ---: | --- | --- | --- |
| **Claude Opus 4.6** | 1M | 1 | 14 Mar 2026 | 14 Mar 2026 | Claude Code |
| **Claude Opus 4.6** |  | 4 | 7 Feb 2026 | 17 Feb 2026 | Claude Code |
| **Claude Opus 4.5** |  | 17 | 17 Jan 2026 | 1 Feb 2026 | Claude Code |
| **Claude Sonnet 4.5** |  | 16 | 3 Jan 2026 | 17 Feb 2026 | Claude Code |

[Across AnttiRask](/repos/AnttiRask.md#ai)

## History

[Method](/about/archive.md)

The line runs from the first release of col2hex2col on 21 Jan 2026 to 28 Oct 2026 and marks all 2 of its releases.

| Version | Released | R |
| --- | --- | ---: |
| [0.5.3](/cran/col2hex2col/v/0.5.3.md) current | 18 Feb 2026 | 4.5.2 |
| [0.3.1](/cran/col2hex2col/v/0.3.1.md) | 21 Jan 2026 | 4.5.2 |

**Release notes (0.5.3)**

**Administrative**

- Added `LICENSE.md` file so GitHub correctly displays the MIT license
- Updated LICENSE year to 2026
- Added copyright holder (`[cph]`) role to `Authors@R` in DESCRIPTION

---

R Observatory is independent of the R Project, CRAN and Bioconductor. The same page for people is at /cran/col2hex2col, and every address is listed at /llms.txt.
