R/LINGRAY.R

Defines functions LinGray

Documented in LinGray

LinGray <- function(n,beg = 1,end = 92)
{
    if(beg < 1 || end < 1 || beg > 256 || end > 256)
	stop("`beg' and `end' must be numbers in the interval [1,256]")

    M <- rbind(c(0,0,0),
	       c(0,0,0),
	       c(1,1,1),
	       c(1,1,1),
	       c(2,2,2),
	       c(3,3,3),
	       c(4,4,4),
	       c(5,5,5),
	       c(6,6,6),
	       c(7,7,7),
	       c(8,8,8),
	       c(9,9,9),
	       c(10,10,10),
	       c(11,11,11),
	       c(12,12,12),
	       c(13,13,13),
	       c(14,14,14),
	       c(15,15,15),
	       c(16,16,16),
	       c(17,17,17),
	       c(18,18,18),
	       c(19,19,19),
	       c(20,20,20),
	       c(21,21,21),
	       c(22,22,22),
	       c(23,23,23),
	       c(24,24,24),
	       c(25,25,25),
	       c(26,26,26),
	       c(27,27,27),
	       c(28,28,28),
	       c(29,29,29),
	       c(30,30,30),
	       c(32,32,32),
	       c(34,34,34),
	       c(35,35,35),
	       c(37,37,37),
	       c(39,39,39),
	       c(41,41,41),
	       c(43,43,43),
	       c(45,45,45),
	       c(46,46,46),
	       c(47,47,47),
	       c(49,49,49),
	       c(51,51,51),
	       c(52,52,52),
	       c(54,54,54),
	       c(56,56,56),
	       c(59,59,59),
	       c(61,61,61),
	       c(64,64,64),
	       c(67,67,67),
	       c(69,69,69),
	       c(72,72,72),
	       c(75,75,75),
	       c(76,76,76),
	       c(78,78,78),
	       c(81,81,81),
	       c(84,84,84),
	       c(87,87,87),
	       c(91,91,91),
	       c(94,94,94),
	       c(97,97,97),
	       c(101,101,101),
	       c(104,104,104),
	       c(107,107,107),
	       c(108,108,108),
	       c(112,112,112),
	       c(116,116,116),
	       c(120,120,120),
	       c(124,124,124),
	       c(128,128,128),
	       c(132,132,132),
	       c(136,136,136),
	       c(141,141,141),
	       c(145,145,145),
	       c(147,147,147),
	       c(150,150,150),
	       c(154,154,154),
	       c(159,159,159),
	       c(164,164,164),
	       c(169,169,169),
	       c(174,174,174),
	       c(179,179,179),
	       c(185,185,185),
	       c(190,190,190),
	       c(195,195,195),
	       c(201,201,201),
	       c(207,207,207),
	       c(212,212,212),
	       c(216,216,216),
	       c(218,218,218),
	       c(224,224,224),
	       c(226,226,226),
	       c(230,230,230),
	       c(237,237,237),
	       c(243,243,243),
	       c(245,245,245),
	       c(252,252,252),
	       c(255,255,255),
	       c(255,255,255))[round(seq(beg,end,length = n)), ]

    rgb(M[,1]/255,
	M[,2]/255,
	M[,3]/255)
}

Try the hexbin package in your browser

Any scripts or data that you put into this service are public.

hexbin documentation built on April 12, 2025, 1:35 a.m.