{ "metadata": { "name": "learning_colors" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "Learning Colors with show_color and embed_colorpicker" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "A prerequisite to playing with [`ipythonblocks`](https://github.com/jiffyclub/ipythonblocks) is understanding how RGB colors work. To make it easy for students to experiment with different combinations of RGB `ipythonblocks` includes a `show_color` function that just shows a big stripe of a given color." ] }, { "cell_type": "code", "collapsed": false, "input": [ "from ipythonblocks import show_color, embed_colorpicker" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 1 }, { "cell_type": "code", "collapsed": false, "input": [ "show_color(12, 123, 234)" ], "language": "python", "metadata": {}, "outputs": [ { "html": [ "
" ], "output_type": "display_data", "text": [ "" ] } ], "prompt_number": 2 }, { "cell_type": "markdown", "metadata": {}, "source": [ "If students are expected to have an internet connection the `embed_colorpicker` function can be used to embed the website [ColorPicker.com](http://www.colorpicker.com/) in the Notebook." ] }, { "cell_type": "code", "collapsed": false, "input": [ "embed_colorpicker()" ], "language": "python", "metadata": {}, "outputs": [ { "html": [ "" ], "output_type": "display_data", "text": [ "" ] } ], "prompt_number": 3 }, { "cell_type": "code", "collapsed": false, "input": [], "language": "python", "metadata": {}, "outputs": [] } ], "metadata": {} } ] }