Skip to content

Commit

Permalink
Merge branch 'editable'
Browse files Browse the repository at this point in the history
  • Loading branch information
FiratUsta committed Nov 3, 2024
2 parents f87f9b0 + ca50d60 commit af1b84d
Show file tree
Hide file tree
Showing 10 changed files with 438 additions and 25 deletions.
28 changes: 28 additions & 0 deletions src/assets/delete.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 46 additions & 0 deletions src/assets/duplicate.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions src/assets/revert.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions src/classes/color.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ class Color{
this.blue = b;
}

fromRGB(r, g, b){
this.red = r;
this.green = g;
this.blue = b;

return this;
}

fromHSV(hue, saturation, value){
const C = value * saturation;
const X = C * (1 - Math.abs(((hue / 60) % 2) - 1));
Expand Down
13 changes: 13 additions & 0 deletions src/classes/indexer.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,19 @@ class Indexer{
return (0.3 * (r * r)) + (0.59 * (g * g)) + (0.11 * (b *b));
}

findName(color){
let similar = [null, 999];

this.nameArray.forEach(name => {
const simIndex = this._calculateSimilarity(name["rgb"], color);
if(simIndex < similar[1]){
similar = [name["name"], simIndex];
};
})

return similar[0];
}

async findMultiple(colors){
const self = this;

Expand Down
2 changes: 1 addition & 1 deletion src/classes/paletteViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class PaletteViewer{
const self = this;

return new Promise(function(resolve){
const palette = self.parent.colorGenerator.getPalette(true);
const palette = self.parent.domManager.swatchDisplay.getPalette(true);
const buttonColor = self.parent.domManager.themer.textColorFromColor(palette[0]);
if(buttonColor === "#363636"){
Elements.VIEWER_TOGGLE.classList.remove("dark");
Expand Down
Loading

0 comments on commit af1b84d

Please sign in to comment.