Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- noun_type_color = new CmdUtils.NounType( "color",
- ["red", "orange", "yellow", "green", "blue", "violet", "black", "white",
- "grey", "brown", "beige", "magenta", "cerulean", "puce"]
- );
- CmdUtils.CreateCommand({
- name: "get-color-code",
- takes: {"color": noun_type_color},
- preview: function( pblock, theColour) {
- var colour = "FFFFFF";
- if (theColour.text == "black")
- {
- colour = "000000";
- }
- var msg = 'Colour code for '+ theColour.text+'is: ' + colour ;
- pblock.innerHTML = msg ;
- },
- execute: function(theColour) {
- var colour = "FFFFFF";
- if (theColour.text == "black")
- {
- colour = "000000";
- }
- CmdUtils.setSelection(colour );
- }
- });
Add Comment
Please, Sign In to add comment