1: ================================================================================ 2: 3: Smalltalk.KSU defineClass: #ColorHSB 4: superclass: #{KSU.ColorAbstract} 5: indexedType: #none 6: private: false 7: instanceVariableNames: '' 8: classInstanceVariableNames: '' 9: imports: '' 10: category: 'KSU-Template' 11: 12: ================================================================================ 13: 14: KSU.ColorHSB method for 'aspects' 15: 16: brightnessGauge 17: 18: ^self thirdGauge 19: 20: ------------------------------------------------------------ 21: 22: KSU.ColorHSB method for 'interface opening' 23: 24: brightnessView 25: 26: | aView | 27: aView := ColorHSBView model: self. 28: aView aspectSelector: #brightness. 29: ^aView 30: 31: ------------------------------------------------------------ 32: 33: KSU.ColorHSB method for 'accessing' 34: 35: color 36: 37: | aColor | 38: aColor := ColorValue 39: hue: (0 max: (self hueGauge value min: 1)) 40: saturation: (0 max: (self saturationGauge value min: 1)) 41: brightness: (0 max: (self brightnessGauge value min: 1)). 42: ^aColor 43: 44: ------------------------------------------------------------ 45: 46: KSU.ColorHSB method for 'aspects' 47: 48: hueGauge 49: 50: ^self firstGauge 51: 52: ------------------------------------------------------------ 53: 54: KSU.ColorHSB method for 'interface opening' 55: 56: hueView 57: 58: | aView | 59: aView := ColorHSBView model: self. 60: aView aspectSelector: #hue. 61: ^aView 62: 63: ------------------------------------------------------------ 64: 65: KSU.ColorHSB method for 'aspects' 66: 67: saturationGauge 68: 69: ^self secondGauge 70: 71: ------------------------------------------------------------ 72: 73: KSU.ColorHSB method for 'interface opening' 74: 75: saturationView 76: 77: | aView | 78: aView := ColorHSBView model: self. 79: aView aspectSelector: #saturation. 80: ^aView 81: 82: ================================================================================ 83: 84: KSU.ColorHSB class 85: instanceVariableNames: '' 86: 87: ================================================================================ 88: 89: KSU.ColorHSB class method for 'examples' 90: 91: example1 92: "KSU.ColorHSB example1." 93: 94: | anApplication | 95: anApplication := KSU.ColorHSB new. 96: anApplication open. 97: ^anApplication 98: 99: ------------------------------------------------------------ 100: 101: KSU.ColorHSB class method for 'interface specs' 102: 103: windowSpec 104: "Tools.UIPainter new openOnClass: self andSelector: #windowSpec" 105: 106: <resource: #canvas> 107: ^#(#{UI.FullSpec} 108: #window: 109: #(#{UI.WindowSpec} 110: #label: '色相・彩度・明度' 111: #min: #(#{Core.Point} 512 160 ) 112: #max: #(#{Core.Point} 512 160 ) 113: #bounds: #(#{Graphics.Rectangle} 1024 640 1536 800 ) 114: #flags: 4 115: #menu: #menuBar ) 116: #component: 117: #(#{UI.SpecCollection} 118: #collection: #( 119: #(#{UI.LabelSpec} 120: #layout: #(#{Core.Point} 24 17 ) 121: #name: #hueLabel 122: #colors: 123: #(#{UI.LookPreferences} 124: #setBackgroundColor: #(#{Graphics.ColorValue} #pink ) ) 125: #label: '色相 :' ) 126: #(#{UI.LabelSpec} 127: #layout: #(#{Core.Point} 24 49 ) 128: #name: #saturationLabel 129: #colors: 130: #(#{UI.LookPreferences} 131: #setBackgroundColor: #(#{Graphics.ColorValue} 6143 8191 6143 ) ) 132: #label: '彩度:' ) 133: #(#{UI.LabelSpec} 134: #layout: #(#{Core.Point} 24 81 ) 135: #name: #brightnessLabel 136: #colors: 137: #(#{UI.LookPreferences} 138: #setBackgroundColor: #(#{Graphics.ColorValue} 6143 6143 8191 ) ) 139: #label: '明度:' ) 140: #(#{UI.ArbitraryComponentSpec} 141: #layout: #(#{Graphics.Rectangle} 72 17 488 40 ) 142: #name: #hueView 143: #component: #hueView ) 144: #(#{UI.ArbitraryComponentSpec} 145: #layout: #(#{Graphics.Rectangle} 72 49 488 72 ) 146: #name: #saturationView 147: #component: #saturationView ) 148: #(#{UI.ArbitraryComponentSpec} 149: #layout: #(#{Graphics.Rectangle} 72 81 488 104 ) 150: #name: #brightnessView 151: #component: #brightnessView ) ) ) ) 152: 153: ================================================================================
This document was generated by KSU.TextDoclet on 2012/11/10 at 10:56:49.