{"action":"created","comment":{"url":"https://api.github.com/repos/react-melon/melon/pulls/comments/66741750","id":66741750,"diff_hunk":"@@ -0,0 +1,315 @@\n+/**\n+ * @file Color\n+ * @author zhangjingyuan(zhangjingyuan02@baidu.com)\n+ */\n+\n+import React, {Component} from 'react';\n+import ColorBox from './color/box';\n+import Icon  from './Icon';\n+import Mask from './Mask';\n+import Button from './Button';\n+import {create} from './common/util/cxBuilder';\n+\n+const cx = create('Color');\n+const HEXCH = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'];\n+\n+export default class Color extends Component {\n+    constructor(props) {\n+        super(props);\n+\n+        this.onSubmit = this.onSubmit.bind(this);\n+        this.onHueChange = this.onHueChange.bind(this);\n+        this.onSaturationChange = this.onSaturationChange.bind(this);\n+        this.ondemoChange = this.ondemoChange.bind(this);\n+        this.onLabelClick = this.onLabelClick.bind(this);\n+        this.onHexChange = this.onHexChange.bind(this);\n+        this.state = {\n+            satValue: '00FFE7',\n+            value: '00FFE7',\n+            open: false,\n+            color: '#FFFFFF',\n+            rgb: [0, 255, 231],\n+            boxes: [\n+                {color: 'FF425E',\n+                hue: 'FF0059'},\n+                {color: 'C6EDE8',\n+                hue: '00FFF9'},\n+                {color: '66CCCC',\n+                hue: '00FFF9'},\n+                {color: 'FFFFFF',\n+                hue: '00FFF9'},\n+                {color: '000000',\n+                hue: '0079FF'},\n+                {color: 'CCCCCC',\n+                hue: '00CCFF'},\n+                {color: '576069',\n+                hue: 'FF0026'},\n+                {color: 'E2D3AC',\n+                hue: 'FFC600'},\n+                {color: 'FDDA04',\n+                hue: 'FFDF00'},\n+                {color: 'E58308',\n+                hue: 'FF8C00'},\n+                {color: 'FF99CC',\n+                hue: 'FF00BF'},\n+                {color: 'FC9D9B',\n+                hue: 'FF0000'},\n+                {color: '59453E',\n+                hue: 'FF0000'},\n+                {color: 'CCFF00',\n+                hue: 'B3FF00'}\n+            ]\n+        };\n+    }\n+\n+    // 点击TextBox时打开颜色选择器\n+    onLabelClick(e) {\n+        const {disabled, readOnly} = this.props;\n+\n+        if (disabled || readOnly) {\n+            return;\n+        }\n+        this.setState({\n+            open: true,\n+            top: e.pageY + 20,\n+            left: e.pageX + 20\n+        });\n+    }\n+\n+    // 检查用户输入的rgb是否正确\n+    checkRGB() {\n+        let rgbStr = document.getElementsByName('rgbStr')[0];\n+        let rgb = rgbStr.value;\n+        if (rgb.length !== 3 && rgb.length !== 6) {\n+            rgbStr.style.border = '1px red solid';\n+            return;\n+        }\n+        rgbStr.style.border = 'none';\n+    }\n+\n+    // 提交所选颜色\n+    onSubmit() {\n+        if (document.getElementsByName('rgbStr')[0].style.borderColor === 'red') {","path":"src/Color.js","position":92,"original_position":92,"commit_id":"a83a6256772aa658b956068650ee32e2026f079a","original_commit_id":"a83a6256772aa658b956068650ee32e2026f079a","user":{"login":"cxtom","id":8544960,"avatar_url":"https://avatars.githubusercontent.com/u/8544960?v=3","gravatar_id":"","url":"https://api.github.com/users/cxtom","html_url":"https://github.com/cxtom","followers_url":"https://api.github.com/users/cxtom/followers","following_url":"https://api.github.com/users/cxtom/following{/other_user}","gists_url":"https://api.github.com/users/cxtom/gists{/gist_id}","starred_url":"https://api.github.com/users/cxtom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cxtom/subscriptions","organizations_url":"https://api.github.com/users/cxtom/orgs","repos_url":"https://api.github.com/users/cxtom/repos","events_url":"https://api.github.com/users/cxtom/events{/privacy}","received_events_url":"https://api.github.com/users/cxtom/received_events","type":"User","site_admin":false},"body":"有人想用黄色代表警告咋办","created_at":"2016-06-13T05:35:33Z","updated_at":"2016-06-13T05:35:33Z","html_url":"https://github.com/react-melon/melon/pull/33#discussion_r66741750","pull_request_url":"https://api.github.com/repos/react-melon/melon/pulls/33","_links":{"self":{"href":"https://api.github.com/repos/react-melon/melon/pulls/comments/66741750"},"html":{"href":"https://github.com/react-melon/melon/pull/33#discussion_r66741750"},"pull_request":{"href":"https://api.github.com/repos/react-melon/melon/pulls/33"}}},"pull_request":{"url":"https://api.github.com/repos/react-melon/melon/pulls/33","id":71546962,"html_url":"https://github.com/react-melon/melon/pull/33","diff_url":"https://github.com/react-melon/melon/pull/33.diff","patch_url":"https://github.com/react-melon/melon/pull/33.patch","issue_url":"https://api.github.com/repos/react-melon/melon/issues/33","number":33,"state":"open","locked":false,"title":"color 添加了选色器组件","user":{"login":"JingyuanZhang","id":10822846,"avatar_url":"https://avatars.githubusercontent.com/u/10822846?v=3","gravatar_id":"","url":"https://api.github.com/users/JingyuanZhang","html_url":"https://github.com/JingyuanZhang","followers_url":"https://api.github.com/users/JingyuanZhang/followers","following_url":"https://api.github.com/users/JingyuanZhang/following{/other_user}","gists_url":"https://api.github.com/users/JingyuanZhang/gists{/gist_id}","starred_url":"https://api.github.com/users/JingyuanZhang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JingyuanZhang/subscriptions","organizations_url":"https://api.github.com/users/JingyuanZhang/orgs","repos_url":"https://api.github.com/users/JingyuanZhang/repos","events_url":"https://api.github.com/users/JingyuanZhang/events{/privacy}","received_events_url":"https://api.github.com/users/JingyuanZhang/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-05-26T12:26:17Z","updated_at":"2016-06-13T05:35:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"456658e3b64a0c830a3a9ada53cdf6215a4258f6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/react-melon/melon/pulls/33/commits","review_comments_url":"https://api.github.com/repos/react-melon/melon/pulls/33/comments","review_comment_url":"https://api.github.com/repos/react-melon/melon/pulls/comments{/number}","comments_url":"https://api.github.com/repos/react-melon/melon/issues/33/comments","statuses_url":"https://api.github.com/repos/react-melon/melon/statuses/a83a6256772aa658b956068650ee32e2026f079a","head":{"label":"JingyuanZhang:master","ref":"master","sha":"a83a6256772aa658b956068650ee32e2026f079a","user":{"login":"JingyuanZhang","id":10822846,"avatar_url":"https://avatars.githubusercontent.com/u/10822846?v=3","gravatar_id":"","url":"https://api.github.com/users/JingyuanZhang","html_url":"https://github.com/JingyuanZhang","followers_url":"https://api.github.com/users/JingyuanZhang/followers","following_url":"https://api.github.com/users/JingyuanZhang/following{/other_user}","gists_url":"https://api.github.com/users/JingyuanZhang/gists{/gist_id}","starred_url":"https://api.github.com/users/JingyuanZhang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JingyuanZhang/subscriptions","organizations_url":"https://api.github.com/users/JingyuanZhang/orgs","repos_url":"https://api.github.com/users/JingyuanZhang/repos","events_url":"https://api.github.com/users/JingyuanZhang/events{/privacy}","received_events_url":"https://api.github.com/users/JingyuanZhang/received_events","type":"User","site_admin":false},"repo":{"id":59659656,"name":"melon","full_name":"JingyuanZhang/melon","owner":{"login":"JingyuanZhang","id":10822846,"avatar_url":"https://avatars.githubusercontent.com/u/10822846?v=3","gravatar_id":"","url":"https://api.github.com/users/JingyuanZhang","html_url":"https://github.com/JingyuanZhang","followers_url":"https://api.github.com/users/JingyuanZhang/followers","following_url":"https://api.github.com/users/JingyuanZhang/following{/other_user}","gists_url":"https://api.github.com/users/JingyuanZhang/gists{/gist_id}","starred_url":"https://api.github.com/users/JingyuanZhang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JingyuanZhang/subscriptions","organizations_url":"https://api.github.com/users/JingyuanZhang/orgs","repos_url":"https://api.github.com/users/JingyuanZhang/repos","events_url":"https://api.github.com/users/JingyuanZhang/events{/privacy}","received_events_url":"https://api.github.com/users/JingyuanZhang/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/JingyuanZhang/melon","description":"react ui comopents","fork":true,"url":"https://api.github.com/repos/JingyuanZhang/melon","forks_url":"https://api.github.com/repos/JingyuanZhang/melon/forks","keys_url":"https://api.github.com/repos/JingyuanZhang/melon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JingyuanZhang/melon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JingyuanZhang/melon/teams","hooks_url":"https://api.github.com/repos/JingyuanZhang/melon/hooks","issue_events_url":"https://api.github.com/repos/JingyuanZhang/melon/issues/events{/number}","events_url":"https://api.github.com/repos/JingyuanZhang/melon/events","assignees_url":"https://api.github.com/repos/JingyuanZhang/melon/assignees{/user}","branches_url":"https://api.github.com/repos/JingyuanZhang/melon/branches{/branch}","tags_url":"https://api.github.com/repos/JingyuanZhang/melon/tags","blobs_url":"https://api.github.com/repos/JingyuanZhang/melon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JingyuanZhang/melon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JingyuanZhang/melon/git/refs{/sha}","trees_url":"https://api.github.com/repos/JingyuanZhang/melon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JingyuanZhang/melon/statuses/{sha}","languages_url":"https://api.github.com/repos/JingyuanZhang/melon/languages","stargazers_url":"https://api.github.com/repos/JingyuanZhang/melon/stargazers","contributors_url":"https://api.github.com/repos/JingyuanZhang/melon/contributors","subscribers_url":"https://api.github.com/repos/JingyuanZhang/melon/subscribers","subscription_url":"https://api.github.com/repos/JingyuanZhang/melon/subscription","commits_url":"https://api.github.com/repos/JingyuanZhang/melon/commits{/sha}","git_commits_url":"https://api.github.com/repos/JingyuanZhang/melon/git/commits{/sha}","comments_url":"https://api.github.com/repos/JingyuanZhang/melon/comments{/number}","issue_comment_url":"https://api.github.com/repos/JingyuanZhang/melon/issues/comments{/number}","contents_url":"https://api.github.com/repos/JingyuanZhang/melon/contents/{+path}","compare_url":"https://api.github.com/repos/JingyuanZhang/melon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JingyuanZhang/melon/merges","archive_url":"https://api.github.com/repos/JingyuanZhang/melon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JingyuanZhang/melon/downloads","issues_url":"https://api.github.com/repos/JingyuanZhang/melon/issues{/number}","pulls_url":"https://api.github.com/repos/JingyuanZhang/melon/pulls{/number}","milestones_url":"https://api.github.com/repos/JingyuanZhang/melon/milestones{/number}","notifications_url":"https://api.github.com/repos/JingyuanZhang/melon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JingyuanZhang/melon/labels{/name}","releases_url":"https://api.github.com/repos/JingyuanZhang/melon/releases{/id}","deployments_url":"https://api.github.com/repos/JingyuanZhang/melon/deployments","created_at":"2016-05-25T12:03:51Z","updated_at":"2016-05-25T12:03:53Z","pushed_at":"2016-06-09T14:40:21Z","git_url":"git://github.com/JingyuanZhang/melon.git","ssh_url":"git@github.com:JingyuanZhang/melon.git","clone_url":"https://github.com/JingyuanZhang/melon.git","svn_url":"https://github.com/JingyuanZhang/melon","homepage":null,"size":2873,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"react-melon:master","ref":"master","sha":"9aa0a9435d1c887a1c194de6b85729909b3c4e7a","user":{"login":"react-melon","id":14071026,"avatar_url":"https://avatars.githubusercontent.com/u/14071026?v=3","gravatar_id":"","url":"https://api.github.com/users/react-melon","html_url":"https://github.com/react-melon","followers_url":"https://api.github.com/users/react-melon/followers","following_url":"https://api.github.com/users/react-melon/following{/other_user}","gists_url":"https://api.github.com/users/react-melon/gists{/gist_id}","starred_url":"https://api.github.com/users/react-melon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/react-melon/subscriptions","organizations_url":"https://api.github.com/users/react-melon/orgs","repos_url":"https://api.github.com/users/react-melon/repos","events_url":"https://api.github.com/users/react-melon/events{/privacy}","received_events_url":"https://api.github.com/users/react-melon/received_events","type":"Organization","site_admin":false},"repo":{"id":41532260,"name":"melon","full_name":"react-melon/melon","owner":{"login":"react-melon","id":14071026,"avatar_url":"https://avatars.githubusercontent.com/u/14071026?v=3","gravatar_id":"","url":"https://api.github.com/users/react-melon","html_url":"https://github.com/react-melon","followers_url":"https://api.github.com/users/react-melon/followers","following_url":"https://api.github.com/users/react-melon/following{/other_user}","gists_url":"https://api.github.com/users/react-melon/gists{/gist_id}","starred_url":"https://api.github.com/users/react-melon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/react-melon/subscriptions","organizations_url":"https://api.github.com/users/react-melon/orgs","repos_url":"https://api.github.com/users/react-melon/repos","events_url":"https://api.github.com/users/react-melon/events{/privacy}","received_events_url":"https://api.github.com/users/react-melon/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/react-melon/melon","description":"react ui comopents","fork":false,"url":"https://api.github.com/repos/react-melon/melon","forks_url":"https://api.github.com/repos/react-melon/melon/forks","keys_url":"https://api.github.com/repos/react-melon/melon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/react-melon/melon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/react-melon/melon/teams","hooks_url":"https://api.github.com/repos/react-melon/melon/hooks","issue_events_url":"https://api.github.com/repos/react-melon/melon/issues/events{/number}","events_url":"https://api.github.com/repos/react-melon/melon/events","assignees_url":"https://api.github.com/repos/react-melon/melon/assignees{/user}","branches_url":"https://api.github.com/repos/react-melon/melon/branches{/branch}","tags_url":"https://api.github.com/repos/react-melon/melon/tags","blobs_url":"https://api.github.com/repos/react-melon/melon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/react-melon/melon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/react-melon/melon/git/refs{/sha}","trees_url":"https://api.github.com/repos/react-melon/melon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/react-melon/melon/statuses/{sha}","languages_url":"https://api.github.com/repos/react-melon/melon/languages","stargazers_url":"https://api.github.com/repos/react-melon/melon/stargazers","contributors_url":"https://api.github.com/repos/react-melon/melon/contributors","subscribers_url":"https://api.github.com/repos/react-melon/melon/subscribers","subscription_url":"https://api.github.com/repos/react-melon/melon/subscription","commits_url":"https://api.github.com/repos/react-melon/melon/commits{/sha}","git_commits_url":"https://api.github.com/repos/react-melon/melon/git/commits{/sha}","comments_url":"https://api.github.com/repos/react-melon/melon/comments{/number}","issue_comment_url":"https://api.github.com/repos/react-melon/melon/issues/comments{/number}","contents_url":"https://api.github.com/repos/react-melon/melon/contents/{+path}","compare_url":"https://api.github.com/repos/react-melon/melon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/react-melon/melon/merges","archive_url":"https://api.github.com/repos/react-melon/melon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/react-melon/melon/downloads","issues_url":"https://api.github.com/repos/react-melon/melon/issues{/number}","pulls_url":"https://api.github.com/repos/react-melon/melon/pulls{/number}","milestones_url":"https://api.github.com/repos/react-melon/melon/milestones{/number}","notifications_url":"https://api.github.com/repos/react-melon/melon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/react-melon/melon/labels{/name}","releases_url":"https://api.github.com/repos/react-melon/melon/releases{/id}","deployments_url":"https://api.github.com/repos/react-melon/melon/deployments","created_at":"2015-08-28T07:00:33Z","updated_at":"2016-06-04T08:51:01Z","pushed_at":"2016-06-12T11:35:26Z","git_url":"git://github.com/react-melon/melon.git","ssh_url":"git@github.com:react-melon/melon.git","clone_url":"https://github.com/react-melon/melon.git","svn_url":"https://github.com/react-melon/melon","homepage":null,"size":2893,"stargazers_count":7,"watchers_count":7,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2,"mirror_url":null,"open_issues_count":5,"forks":2,"open_issues":5,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/react-melon/melon/pulls/33"},"html":{"href":"https://github.com/react-melon/melon/pull/33"},"issue":{"href":"https://api.github.com/repos/react-melon/melon/issues/33"},"comments":{"href":"https://api.github.com/repos/react-melon/melon/issues/33/comments"},"review_comments":{"href":"https://api.github.com/repos/react-melon/melon/pulls/33/comments"},"review_comment":{"href":"https://api.github.com/repos/react-melon/melon/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/react-melon/melon/pulls/33/commits"},"statuses":{"href":"https://api.github.com/repos/react-melon/melon/statuses/a83a6256772aa658b956068650ee32e2026f079a"}}}}
{"actor":{"display_login":"cxtom"}}