@@ -158,6 +158,18 @@ var math = {
158158 caculateAngle : caculateAngle
159159} ;
160160
161+ /**
162+ * @method RGBtoHSV
163+ *
164+ * convert rgb to hsv
165+ *
166+ * color.RGBtoHSV(0, 0, 255) === { h : 240, s : 1, v : 1 } === '#FFFF00'
167+ *
168+ * @param {Number } R red color value
169+ * @param {Number } G green color value
170+ * @param {Number } B blue color value
171+ * @return {Object } hsv color code
172+ */
161173function RGBtoHSV ( r , g , b ) {
162174
163175 if ( arguments . length == 1 ) {
@@ -469,6 +481,18 @@ var fromLAB = {
469481 LABtoXYZ : LABtoXYZ
470482} ;
471483
484+ /**
485+ * @method HSVtoRGB
486+ *
487+ * convert hsv to rgb
488+ *
489+ * color.HSVtoRGB(0,0,1) === #FFFFF === { r : 255, g : 0, b : 0 }
490+ *
491+ * @param {Number } H hue color number (min : 0, max : 360)
492+ * @param {Number } S Saturation number (min : 0, max : 1)
493+ * @param {Number } V Value number (min : 0, max : 1 )
494+ * @returns {Object }
495+ */
472496function HSVtoRGB ( h , s , v ) {
473497
474498 if ( arguments . length == 1 ) {
@@ -1086,6 +1110,15 @@ var parser = {
10861110 color_split : color_split
10871111} ;
10881112
1113+ /**
1114+ * @deprecated
1115+ *
1116+ * instead of this, use blend function
1117+ *
1118+ * @param {* } startColor
1119+ * @param {* } endColor
1120+ * @param {* } t
1121+ */
10891122function interpolateRGB ( startColor , endColor ) {
10901123 var t = arguments . length > 2 && arguments [ 2 ] !== undefined ? arguments [ 2 ] : 0.5 ;
10911124 var exportFormat = arguments . length > 3 && arguments [ 3 ] !== undefined ? arguments [ 3 ] : 'hex' ;
@@ -1906,6 +1939,7 @@ function crop() {
19061939 } ;
19071940}
19081941
1942+ // Image manupulate
19091943function resize ( dstWidth , dstHeight ) {
19101944 return function ( bitmap , done ) {
19111945 var c = Canvas . drawPixels ( bitmap ) ;
@@ -2131,6 +2165,9 @@ function bitonal(darkColor, lightColor) {
21312165 } ) ;
21322166}
21332167
2168+ /*
2169+ * @param {Number } amount -100..100 , value < 0 is darken, value > 0 is brighten
2170+ */
21342171function brightness$1 ( ) {
21352172 var amount = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : 1 ;
21362173
@@ -2158,6 +2195,10 @@ function brownie() {
21582195 } ) ;
21592196}
21602197
2198+ /**
2199+ *
2200+ * @param {Number } amount from 0 to 100
2201+ */
21612202function clip ( ) {
21622203 var amount = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : 0 ;
21632204
@@ -2172,6 +2213,10 @@ function clip() {
21722213 } , { $C : $C } ) ;
21732214}
21742215
2216+ /**
2217+ *
2218+ * @param {* } amount min = -128, max = 128
2219+ */
21752220function contrast$1 ( ) {
21762221 var amount = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : 0 ;
21772222
@@ -2196,6 +2241,10 @@ function gamma() {
21962241 } , { $C : $C } ) ;
21972242}
21982243
2244+ /**
2245+ * F.gradient('red', 'blue', 'yellow', 'white', 10)
2246+ * F.gradient('red, blue, yellow, white, 10')
2247+ */
21992248function gradient$1 ( ) {
22002249 // 전체 매개변수 기준으로 파싱
22012250 // 색이 아닌 것 기준으로 scale 변수로 인식
@@ -2267,6 +2316,9 @@ function grayscale(amount) {
22672316 } ) ;
22682317}
22692318
2319+ /*
2320+ * @param {Number } amount 0..360
2321+ */
22702322function hue ( ) {
22712323 var amount = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : 360 ;
22722324
@@ -2350,6 +2402,10 @@ function matrix() {
23502402 } ) ;
23512403}
23522404
2405+ /**
2406+ *
2407+ * @param {Number } amount 1..100
2408+ */
23532409function noise ( ) {
23542410 var amount = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : 1 ;
23552411
@@ -2393,6 +2449,9 @@ function polaroid() {
23932449 } ) ;
23942450}
23952451
2452+ /*
2453+ * @param {Number } amount -100..100
2454+ */
23962455function saturation ( ) {
23972456 var amount = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : 100 ;
23982457
@@ -2412,6 +2471,9 @@ function saturation() {
24122471 } ) ;
24132472}
24142473
2474+ /*
2475+ * @param {Number } amount 0..1
2476+ */
24152477function sepia ( ) {
24162478 var amount = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : 1 ;
24172479
@@ -2464,6 +2526,12 @@ function shift() {
24642526 } ) ;
24652527}
24662528
2529+ /**
2530+ * change the relative darkness of (a part of an image) by overexposure to light.
2531+ * @param {* } r
2532+ * @param {* } g
2533+ * @param {* } b
2534+ */
24672535function solarize ( redValue , greenValue , blueValue ) {
24682536 var $redValue = parseParamNumber ( redValue ) ;
24692537 var $greenValue = parseParamNumber ( greenValue ) ;
@@ -2523,6 +2591,9 @@ function thresholdColor() {
25232591 } ) ;
25242592}
25252593
2594+ /*
2595+ * @param {Number } amount 0..100
2596+ */
25262597function threshold ( ) {
25272598 var scale = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : 200 ;
25282599 var amount = arguments . length > 1 && arguments [ 1 ] !== undefined ? arguments [ 1 ] : 100 ;
@@ -2584,6 +2655,11 @@ function blur () {
25842655 return convolution ( createBlurMatrix ( amount ) ) ;
25852656}
25862657
2658+ /*
2659+ * carve, mold, or stamp a design on (a surface) so that it stands out in relief.
2660+ *
2661+ * @param {Number } amount 0.0 .. 4.0
2662+ */
25872663function emboss ( ) {
25882664 var amount = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : 4 ;
25892665
@@ -4157,13 +4233,22 @@ function normal () {
41574233 return convolution$1 ( [ 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 ] ) ;
41584234}
41594235
4236+ /*
4237+ * carve, mold, or stamp a design on (a surface) so that it stands out in relief.
4238+ *
4239+ * @param {Number } amount 0.0 .. 4.0
4240+ */
41604241function emboss$1 ( ) {
41614242 var amount = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : 4 ;
41624243
41634244 amount = parseParamNumber$1 ( amount ) ;
41644245 return convolution$1 ( [ amount * - 2.0 , - amount , 0.0 , - amount , 1.0 , amount , 0.0 , amount , amount * 2.0 ] ) ;
41654246}
41664247
4248+ /**
4249+ *
4250+ * @param {Number } amount 0..1
4251+ */
41674252function gaussianBlur$1 ( ) {
41684253 var amount = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : 1 ;
41694254
@@ -4280,6 +4365,9 @@ function bitonal$1(darkColor, lightColor) {
42804365 return shader ( '\n if ((pixelColor.r + pixelColor.g + pixelColor.b) > ' + checkVlue + ') {\n outColor = vec4(' + lightColorString + '.rgb, pixelColor.a);\n } else {\n outColor = vec4(' + darkColorString + '.rgb, pixelColor.a);\n }\n ' ) ;
42814366}
42824367
4368+ /*
4369+ * @param {Number } amount -1..1 , value < 0 is darken, value > 0 is brighten
4370+ */
42834371function brightness$2 ( ) {
42844372 var amount = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : 1 ;
42854373
@@ -4317,6 +4405,9 @@ function brownie$1() {
43174405 return matrix$3 ( 0.5997023498159715 , 0.34553243048391263 , - 0.2708298674538042 , 0 , - 0.037703249837783157 , 0.8609577587992641 , 0.15059552388459913 , 0 , 0.24113635128153335 , - 0.07441037908422492 , 0.44972182064877153 , 0 , 0 , 0 , 0 , 1 ) ;
43184406}
43194407
4408+ /*
4409+ * @param {Number } amount 0..1
4410+ */
43204411function clip$1 ( ) {
43214412 var amount = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : 0 ;
43224413
@@ -4333,6 +4424,9 @@ function chaos() {
43334424 return shader ( '\n vec2 st = pixelColor.st;\n st *= ' + C + ';\n \n vec2 ipos = floor(st); // get the integer coords\n\n vec3 color = vec3(random( ipos ));\n\n outColor = vec4(color, pixelColor.a);\n ' ) ;
43344425}
43354426
4427+ /*
4428+ * @param {Number } amount 0..1
4429+ */
43364430function contrast$2 ( ) {
43374431 var amount = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : 1 ;
43384432
@@ -4341,6 +4435,9 @@ function contrast$2() {
43414435 return shader ( '\n outColor = pixelColor * ' + C + ';\n ' ) ;
43424436}
43434437
4438+ /*
4439+ * @param {Number } amount -1..1 , value < 0 is darken, value > 0 is brighten
4440+ */
43444441function gamma$1 ( ) {
43454442 var amount = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : 1 ;
43464443
@@ -4349,6 +4446,10 @@ function gamma$1() {
43494446 return shader ( '\n outColor = vec4(pow(pixelColor.r, ' + C + '), pow(pixelColor.g, ' + C + '), pow(pixelColor.b, ' + C + '), pixelColor.a );\n ' ) ;
43504447}
43514448
4449+ /**
4450+ * F.gradient('red', 'blue', 'yellow', 'white', 10)
4451+ * F.gradient('red, blue, yellow, white, 10')
4452+ */
43524453function gradient$2 ( ) {
43534454 // 전체 매개변수 기준으로 파싱
43544455 // 색이 아닌 것 기준으로 scale 변수로 인식
@@ -4396,6 +4497,10 @@ function gradient$2() {
43964497 return shader ( '\n float rate = (pixelColor.r * 0.2126 + pixelColor.g * 0.7152 + pixelColor.b * 0.0722); \n\n ' + temp . join ( '\n' ) + ' \n ' ) ;
43974498}
43984499
4500+ /**
4501+ *
4502+ * @param {Number } amount 0..1
4503+ */
43994504function grayscale$1 ( ) {
44004505 var amount = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : 1 ;
44014506
@@ -4407,6 +4512,9 @@ function grayscale$1() {
44074512}
44084513
44094514//http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl
4515+ /*
4516+ * @param {Number } amount 0..1 , (real value 0..360)
4517+ */
44104518function hue$1 ( ) {
44114519 var amount = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : 1 ;
44124520
@@ -4428,6 +4536,10 @@ function kodachrome$1() {
44284536 return matrix$3 ( 1.1285582396593525 , - 0.3967382283601348 , - 0.03992559172921793 , 0 , - 0.16404339962244616 , 1.0835251566291304 , - 0.05498805115633132 , 0 , - 0.16786010706155763 , - 0.5603416277695248 , 1.6014850761964943 , 0 , 0 , 0 , 0 , 1 ) ;
44294537}
44304538
4539+ /**
4540+ *
4541+ * @param {Number } amount 0..1
4542+ */
44314543function noise$1 ( ) {
44324544 var amount = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : 1 ;
44334545
@@ -4438,6 +4550,10 @@ function noise$1() {
44384550 return shader ( '\n float rnd = ' + min + ' + random( pixelColor.st ) * (' + max + ' - ' + min + ');\n\n outColor = vec4(pixelColor.rgb + rnd, 1.0);\n ' ) ;
44394551}
44404552
4553+ /**
4554+ *
4555+ * @param {Number } amount 0..1
4556+ */
44414557function opacity$1 ( ) {
44424558 var amount = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : 1 ;
44434559
@@ -4451,6 +4567,9 @@ function polaroid$1() {
44514567 return matrix$3 ( 1.438 , - 0.062 , - 0.062 , 0 , - 0.122 , 1.378 , - 0.122 , 0 , - 0.016 , - 0.016 , 1.483 , 0 , 0 , 0 , 0 , 1 ) ;
44524568}
44534569
4570+ /*
4571+ * @param {Number } amount 0..1
4572+ */
44544573function saturation$1 ( ) {
44554574 var amount = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : 0 ;
44564575
@@ -4459,6 +4578,9 @@ function saturation$1() {
44594578 return matrix$3 ( L , 0 , 0 , 0 , 0 , L , 0 , 0 , 0 , 0 , L , 0 , 0 , 0 , 0 , L ) ;
44604579}
44614580
4581+ /*
4582+ * @param {Number } amount 0..100
4583+ */
44624584function sepia$1 ( ) {
44634585 var amount = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : 1 ;
44644586
@@ -4506,13 +4628,22 @@ function thresholdColor$1() {
45064628 return shader ( '\n float c = ( (pixelColor.r * 0.2126 + pixelColor.g * 0.7152 + pixelColor.b * 0.0722) ) >= ' + scale + ' ? 1.0 : 0.0;\n\n outColor = vec4(c, c, c, pixelColor.a);\n ' ) ;
45074629}
45084630
4631+ /*
4632+ * @param {Number } amount 0..100
4633+ */
45094634function threshold$1 ( ) {
45104635 var scale = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : 200 ;
45114636 var amount = arguments . length > 1 && arguments [ 1 ] !== undefined ? arguments [ 1 ] : 100 ;
45124637
45134638 return thresholdColor$1 ( scale , amount , false ) ;
45144639}
45154640
4641+ /**
4642+ *
4643+ * @param {* } redTint 0..1
4644+ * @param {* } greenTint 0..1
4645+ * @param {* } blueTint 0..1
4646+ */
45164647function tint$1 ( ) {
45174648 var redTint = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : 0 ;
45184649 var greenTint = arguments . length > 1 && arguments [ 1 ] !== undefined ? arguments [ 1 ] : 0 ;
@@ -9120,6 +9251,7 @@ var ColorRing = function (_ColorWheel) {
91209251 return ColorRing ;
91219252} ( ColorWheel ) ;
91229253
9254+ // import ColorWheel from '../ui/ColorWheel'
91239255var RingColorPicker = function ( _BaseColorPicker ) {
91249256 inherits ( RingColorPicker , _BaseColorPicker ) ;
91259257
0 commit comments