Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

RGB2RYB

Convert RGB to RYB and RYB to RGB


Description

Convert RGB (red-green-blue) colours to RYB (red-yellow-blue) colours, and vice versa. Algorithm based on Sugita and Takahashi (2015, 2017)

Usage

RGB2RYB(RGBmat)
RYB2RGB(RYBmat)

Arguments

RGBmat

numeric – matrix of red-green-blue primary colors by column, where rows are individual records of the three primary (RGB) colours. User can specify RGB in terms of 0-1 or 0-255; however, the algorith converts the latter to 0-1.

RYBmat

numeric – matrix of red-yellow-blue primary colors by column, where rows are individual records of the three primary (RYB) colours. User can specify RYB in terms of 0-1 or 0-255; however, the algorith converts the latter to 0-1.

Details

The RYB colour wheel is more commonly used by artists, and provides a more intuitive system when blending colours – red and yellow makes orange, yellow and blue makes green, blue and red makes purple. On the RYB colour wheel, red lies opposite green, but on the RGB colour wheel, red lies opposite cyan.

Value

Matrix of RGB or RYB primary colour intensities, where rows are records and columns are primary colours.

Note

Opposite colours calculated in RYB space (1-RYB) are not always what one expects. For example the colour "purple", RGB {160, 32, 240}, might better be specified as RGB {126, 0, 255} before converting to RYB and inverting.

Author(s)

Rowan Haigh, Program Head – Offshore Rockfish
Pacific Biological Station (PBS), Fisheries & Oceans Canada (DFO), Nanaimo BC
locus opus: Institute of Ocean Sciences (IOS), Sidney BC
Last modified Rd: 2021-01-07

References

Sugita, J. and Takahashi, T. (2017) Computational RYB Color Model and its Applications. IIEEJ Transactions on Image Electronics and Visual Computing 5(2): 110-122.

Sugita, J. and Takahashi, T. (2015) RYB Color Compositing. International Workshop on Applications in Information Technology, October 8-10, 2015.

See Also

In package PBSmapping:
addBubbles

In package grDevices:
col2rgb, rgb, rgb2hsv


PBSmapping

Mapping Fisheries Data and Spatial Analysis Tools

v2.73.0
GPL (>= 2)
Authors
Jon T. Schnute [aut], Nicholas Boers [aut], Rowan Haigh [aut, cre], Alex Couture-Beil [ctb], Denis Chabot [ctb], Chris Grandin [ctb], Angus Johnson [ctb], Paul Wessel [ctb], Franklin Antonio [ctb], Nicholas J. Lewin-Koh [ctb], Roger Bivand [ctb]
Initial release
2021-01-12

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.