Skip to content
This repository was archived by the owner on Jan 13, 2025. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,14 @@ function hslFixed(hsl_html) {
return `${parts[0]},${parts[1]}%,${parts[2]}%)`
}

/**
* Converts RGB values into normalized form
*/
function normalizeRgb(rbg_html) {
const parts = rbg_html.split(/[(,)]/)
return `rgbNormed(${(parts[1]/255).toFixed(4)},${(parts[2]/255).toFixed(4)},${(parts[3]/255).toFixed(4)})`
}

function initPlus() {
let colors_palette_change = document.getElementById('colors-palette-change')

Expand Down Expand Up @@ -623,6 +631,7 @@ function colorBox(type, color) {
color.html('keyword'),
hslFixed(color.html('hsl')),
color.html('rgb'),
normalizeRgb(color.html('rgb')),
]

let html = ''
Expand Down