Edited brush preview to be a bit more visible

This commit is contained in:
unsettledgames 2021-07-09 23:50:29 +02:00
parent 3f2d67a36e
commit f81019830b
2 changed files with 3 additions and 3 deletions

View File

@ -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;

View File

@ -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();