hsvapalette.html 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <!DOCTYPE html>
  2. <html>
  3. <!--
  4. Copyright 2008 The Closure Library Authors. All Rights Reserved.
  5. Use of this source code is governed by the Apache License, Version 2.0.
  6. See the COPYING file for details.
  7. -->
  8. <!--
  9. -->
  10. <head>
  11. <title>goog.ui.HsvaPalette</title>
  12. <link rel="stylesheet" href="css/demo.css" />
  13. <link rel="stylesheet" href="../css/hsvapalette.css" />
  14. <script src="../base.js"></script>
  15. <script>
  16. goog.require('goog.events');
  17. goog.require('goog.ui.Component.EventType');
  18. goog.require('goog.ui.HsvaPalette');
  19. </script>
  20. </head>
  21. <body>
  22. <h1>goog.ui.HsvaPalette</h1>
  23. <h3>Normal Size</h3>
  24. <script>
  25. var p = new goog.ui.HsvaPalette;
  26. p.render();
  27. </script>
  28. <h3>Smaller Size</h3>
  29. <script>
  30. function linkColors(e) {
  31. e.target.other.setColorRgbaHex(e.target.getColorRgbaHex());
  32. };
  33. var pSmall = new goog.ui.HsvaPalette(null, null, null,
  34. 'goog-hsva-palette-sm');
  35. pSmall.render();
  36. p.other = pSmall;
  37. pSmall.other = p;
  38. goog.events.listen(p, goog.ui.Component.EventType.ACTION, linkColors);
  39. goog.events.listen(pSmall, goog.ui.Component.EventType.ACTION, linkColors);
  40. </script>
  41. </body>
  42. </html>