Amb els grups de programació de 3r d'ESO hem fet una app per a mòbils al laboratori d'aplicacions de code.org per veure com funciona la nomenclatura de colors RGB (Red, Green, Blue).
En aquest enllaç trobareu les que hem fet tots els alumnes (veure)
Aquest és el codi:
En aquest enllaç trobareu les que hem fet tots els alumnes (veure)
Aquest és el codi:
onEvent("sldVermell", "input", function(event) { setProperty("txtColours", "background-color", rgb(getProperty("sldVermell", "value"), getProperty("sldVerd", "value"), getProperty("sldBlau", "value"))); setProperty("labelTEXT", "text-color", rgb(getProperty("sldVermell", "value"),getProperty("sldVerd", "value"),getProperty("sldBlau", "value"))); setText("txtVermell", getProperty("sldVermell", "value"));});onEvent("sldVerd", "input", function(event) { setProperty("txtColours", "background-color", rgb(getProperty("sldVermell", "value"), getProperty("sldVerd", "value"), getProperty("sldBlau", "value"))); setProperty("labelTEXT", "text-color", rgb(getProperty("sldVermell", "value"),getProperty("sldVerd", "value"),getProperty("sldBlau", "value"))); setText("txtVerd", getProperty("sldVerd", "value"));});onEvent("sldBlau", "input", function(event) { setProperty("txtColours", "background-color", rgb(getProperty("sldVermell", "value"), getProperty("sldVerd", "value"), getProperty("sldBlau", "value"))); setProperty("labelTEXT", "text-color", rgb(getProperty("sldVermell", "value"),getProperty("sldVerd", "value"),getProperty("sldBlau", "value"))); setText("txtBlau", getProperty("sldBlau", "value"));});
Cap comentari:
Publica un comentari a l'entrada