-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
35 changed files
with
3,377 additions
and
1,736 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import Hue from '../ui/control/VerticalHue'; | ||
import Opacity from '../ui/control/VerticalOpacity' | ||
import UIElement from '../UIElement'; | ||
|
||
const source = 'mini-control'; | ||
|
||
export default class ColorControl extends UIElement { | ||
|
||
components () { | ||
return { Hue, Opacity } | ||
} | ||
|
||
template () { | ||
return /*html*/` | ||
<div class="control"> | ||
<div target="Opacity" ></div> | ||
<div target="Hue" ></div> | ||
</div> | ||
` | ||
} | ||
|
||
refresh () { | ||
this.setColorUI(); | ||
} | ||
|
||
setColorUI() { | ||
this.Hue.setColorUI() | ||
this.Opacity.setColorUI() | ||
} | ||
|
||
'@changeColor' (sourceType) { | ||
if (source != sourceType) { | ||
this.refresh() | ||
} | ||
} | ||
|
||
'@initColor' () { this.refresh() } | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
import BaseColorPicker from '../BaseColorPicker' | ||
|
||
import ColorControl from './ColorControl' | ||
import ColorPalette from '../ui/ColorPalette' | ||
import Color from '../../util/Color' | ||
|
||
export default class VSCodePicker extends BaseColorPicker { | ||
|
||
template () { | ||
return /*html*/` | ||
<div class='colorpicker-body'> | ||
<div class='color-view'> | ||
<div class='color-view-container' ref="$colorview"></div> | ||
</div> | ||
<div class='color-tool'> | ||
<div target="palette"></div> | ||
<div target="control"></div> | ||
</div> | ||
</div> | ||
` | ||
} | ||
|
||
components() { | ||
return { | ||
palette: ColorPalette, | ||
control: ColorControl | ||
} | ||
} | ||
|
||
initColorWithoutChangeEvent (color) { | ||
console.log(color); | ||
this.$store.dispatch('/initColor', color); | ||
this.refresh(); | ||
} | ||
|
||
setBackgroundColor () { | ||
var color = this.$store.dispatch('/toColor') | ||
var rgb = this.$store.rgb; | ||
var bValue = Color.brightness(rgb.r,rgb.g,rgb.b); | ||
|
||
this.refs.$colorview.css({ | ||
"background-color": color, | ||
'color': bValue > 127 ? 'black': 'white' | ||
}); | ||
this.refs.$colorview.html(color); | ||
} | ||
|
||
'click $colorview' (e) { | ||
this.nextFormat() | ||
} | ||
|
||
nextFormat() { | ||
var current_format = this.$store.format || 'hex'; | ||
|
||
var next_format = 'hex'; | ||
if (current_format == 'hex') { | ||
next_format = 'rgb'; | ||
} else if (current_format == 'rgb') { | ||
next_format = 'hsl'; | ||
} else if (current_format == 'hsl') { | ||
next_format = 'hex'; | ||
} | ||
|
||
this.$store.dispatch('/changeFormat', next_format); | ||
this.$store.emit('lastUpdateColor') | ||
this.refresh(); | ||
} | ||
|
||
refresh () { | ||
this.setBackgroundColor() | ||
} | ||
|
||
'@changeColor' () { | ||
this.refresh() | ||
} | ||
|
||
'@initColor' () { | ||
this.refresh() | ||
} | ||
|
||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.