почему не выводит в консоль значение firstColor.style.backgroundColor ? код: let hue,…
Jump to turn (6)
- 1почему не выводит в консоль значение firstColor.style.backgroundColor ? код: let
- 2почему не выводит в консоль значение color? код: let hue, saturation, lightness;
- 3как реализовать функцию smoothstep glsl в js?
- 4как передать в js код значение, введенное пользователем в инпут?
- 5ошибка: Uncaught TypeError: Cannot read properties of null (reading 'value') htm
- 6как проверить, пустой ли инпут?
- User
почему не выводит в консоль значение firstColor.style.backgroundColor ?
код: let hue, saturation, lightness;
const gradient = document.querySelector('.gradient'); gradient.style.height = '100px'; gradient.style.width = '90%'; gradient.style.background = 'linear-gradient(to right, hsla(0, 76%, 53%, 1), hsla(176, 76%, 53%, 1))';
function hexToHSL(hex) {
codeconst firstColor = document.createElement('div'); firstColor.style.backgroundColor = hex; console.log(firstColor.style.backgroundColor); const color = window.getComputedStyle(firstColor).getPropertyValue('background-color'); console.log(color); return color;} let hex = '№66E22C'; const prettyGradient = document.querySelector('.pretty-gradient'); prettyGradient.style.height = '100px'; prettyGradient.style.width = '90%'; prettyGradient.style.background = 'linear-gradient(to right,' + hexToHSL(hex) + ', hsla(176, 76%, 53%, 1))';
- Assistant