mirror of
https://github.com/lospec/pixel-editor.git
synced 2023-08-10 21:12:51 +03:00
Edited brush preview to be a bit more visible
This commit is contained in:
parent
3f2d67a36e
commit
f81019830b
@ -70,7 +70,7 @@
|
|||||||
|
|
||||||
#brush-preview {
|
#brush-preview {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
border: solid 2px #fff;
|
border: solid 1px #fff;
|
||||||
z-index: 1200;
|
z-index: 1200;
|
||||||
box-shadow: 0 0 2px 0 rgba(0, 0, 0, 0.5), inset 0 0 2px 0 rgba(0, 0, 0, 0.5);
|
box-shadow: 0 0 2px 0 rgba(0, 0, 0, 0.5), inset 0 0 2px 0 rgba(0, 0, 0, 0.5);
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
|
@ -243,8 +243,8 @@ function draw (mouseEvent) {
|
|||||||
var selectedColor = currentLayer.context.getImageData(Math.floor(cursorLocation[0]/zoom),Math.floor(cursorLocation[1]/zoom),1,1).data;
|
var selectedColor = currentLayer.context.getImageData(Math.floor(cursorLocation[0]/zoom),Math.floor(cursorLocation[1]/zoom),1,1).data;
|
||||||
var colorLightness = Math.max(selectedColor[0],selectedColor[1],selectedColor[2])
|
var colorLightness = Math.max(selectedColor[0],selectedColor[1],selectedColor[2])
|
||||||
|
|
||||||
//for the darkest 50% of colors, change the brush preview to dark mode
|
//for the darkest 75% of colors, change the brush preview to dark mode
|
||||||
if (colorLightness>127) brushPreview.classList.remove('dark');
|
if (colorLightness>64) brushPreview.classList.remove('dark');
|
||||||
else brushPreview.classList.add('dark');
|
else brushPreview.classList.add('dark');
|
||||||
|
|
||||||
currentLayer.updateLayerPreview();
|
currentLayer.updateLayerPreview();
|
||||||
|
Loading…
Reference in New Issue
Block a user