Created
August 8, 2023 18:39
-
-
Save vjcitn/c21cc15eff8f204b0862652e044cb540 to your computer and use it in GitHub Desktop.
simple color model exploration with shiny
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(shiny) | |
colorapp2 = function () | |
{ | |
colordot = function (r, g, b) { | |
plot(0, 0, col = grDevices::rgb(r, g, b), pch = 19, cex = 15) | |
} | |
ui = fluidPage( | |
sidebarLayout( | |
sidebarPanel( | |
helpText("sliders for color balance"), | |
sliderInput("red", "red", min = 0, max = 1, step = 0.05, value = 1), | |
sliderInput("green", "green", min = 0, max = 1, step = 0.05, value = 0), | |
sliderInput("blue", "blue", min = 0, max = 1, step = 0.05, value = 0) | |
), | |
mainPanel( | |
tabsetPanel( | |
tabPanel("dot", plotOutput("dot")) | |
) # end tabsetPanel | |
) # end mainPanel | |
) # end layout | |
) # end fluidpage | |
server = function(input, output) { | |
output$dot = renderPlot({ | |
colordot(input$red, input$green, input$blue) | |
}) | |
} | |
runApp(list(ui = ui, server = server)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment