Skip to content

colourspace

Convert from One Colour Space to Another, Print a Ready-to-Paste Modern 'CSS' Syntax

v0.1.1 · Mar 23, 2026 · MIT + file LICENSE

Description

Provides a comprehensive 'API' for colour conversion between popular colour spaces ('RGB', 'HSL', 'OKLab', 'OKLch', 'hex', and named colours) along with clean, modern 'CSS' Color Level 4 syntax output. Integrates seamlessly into 'Shiny' and 'Quarto' workflows. Includes nearest colour name lookup powered by a curated database of over 30,000 colour names. 'OKLab'/'OKLCh' colour spaces are described in Ottosson (2020) <https://bottosson.github.io/posts/oklab/>. 'CSS' Color Level 4 syntax follows the W3C specification <https://www.w3.org/TR/css-color-4/>.

Downloads

CRAN

500

Last 30 days

8116th

1.5K

Last 90 days

2.3K

Last year

Trend: +3.1% (30d vs prior 30d)

r2u CRAN

0

Last 30 days

30

Last 90 days

55

Last year

Trend: -100% (30d vs prior 30d)

autoCRAN

9

Last 7 days

24

Last 30 days

2

All-time

autoCRAN-only: this name is served only by autoCRAN, so the count is exact.

CRAN Check Status

13 OK
Show all 13 flavors
Flavor Status
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

Check History

OK 13 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Mar 10, 2026

Line coverage

Expression

Tests / Examples

Functions

41 13 exported

Complexity

2.9 avg / 11 max

Call network

41 nodes / 56 edges

Test coverage has not been measured for this package yet; nodes fall back to a neutral fill.

Loading call graph…

Lowest coverage

Per-function coverage is not measured for this package yet.

Compare versions

Code

Structure

Lines of code

2,237

Files

48

Compiled share

0%

Has compiled src

No

Language breakdown

R 857 (38.3%)Tests 934 (41.8%)Docs 446 (19.9%)

API

Exported functions

13

Internal functions

28

Recent export changes

v0.0.1+13 convert_colourspace, from_css, hex_to_hsl +10 more

Testing & CI

Has tests

Yes

Test-to-code ratio

1.09

testthat edition

3

CI present

No

CI type

[]

PR gated

No

Docs

Return-value doc rate

100%

\dontrun example ratio

0%

Roxygen coverage

100%

Has pkgdown

No

NEWS present

Yes

Health & Security signals

Informational signals; not verdicts.

on.exit coverage

Unsafe pattern score

0

Dep constraint coverage

0%

Secret pattern count

0

Bundled 3rd-party code

2 items

Portability & License

Min R version

3.5

System requirements

C++ standard

License

MIT + file LICENSE

License flags

SPDX valid, OSI approved

History

Versions

2

First release

2026-03-04

Latest release

2026-03-23

Avg cadence

19 days

Cold removal rate

Dep drift

0

LOC over versions

v0.0.1: 2,093 LOCv0.1.1: 2,237 LOC

Per-file churn detail lives in the source pipeline: https://github.com/r-observatory/cran-code-metrics.

Dependency Network

Dependencies Reverse dependencies farver RANN colourspace

Version History

2 tracked
updated 0.1.1 ← 0.0.1 diff Mar 23, 2026
new 0.0.1 Mar 10, 2026

R Observatory began tracking this package on Mar 10, 2026; it first appeared on CRAN Mar 4, 2026. Releases before tracking aren’t shown.