-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCIE.R
More file actions
40 lines (33 loc) · 779 Bytes
/
Copy pathCIE.R
File metadata and controls
40 lines (33 loc) · 779 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
library(colorspace)
library(RColorBrewer)
i=0
mypalette <- NULL
#array <- as.matrix(1:786432,768,1024)
array <- t(matrix(1:10000,100,100))
j=0
while(i<=100){
while(j<=100){
#Switch to xyY
Y=1
x=i/100
y=j/100
X=(Y/y)*x
Z=(Y/y)*(1-x-y)
## print(X)
## print(Y)
## print(Z)
colort <- XYZ(X, Y,Z)
mypalette <- c(mypalette, hex(colort, gamma = NULL, fixup = FALSE))
j <- j+1
}
i <- i+1
print(i)
j <- 1
}
image((array),col=mypalette,xlab="Greens (sequential)", ylab="",xaxt="n",yaxt="n",bty="n")
#1024x768
colort=XYZ(0.4,0.4,1)
hex(colort, gamma = NULL, fixup = FALSE)
show(as(colort, "RGB"))
mypalette<-brewer.pal(7,"Greens")
image(t(vectorm),col=mypalette,xlab="Greens (sequential)", ylab="",xaxt="n",yaxt="n",bty="n")