Giter Site home page Giter Site logo

Comments (4)

clydebarrow avatar clydebarrow commented on June 20, 2024

So you're suggesting to allow either color: 0xFF0000 or hex: FF0000 as synonyms? That is doable, but would require significant extra code (needs to be done everywhere color is used), and could be confusing in my opinion, for a small gain. You can define ESPHome colors and use the ID in the lvgl config already.

from esphome.

nagyrobi avatar nagyrobi commented on June 20, 2024

I'd just say to allow for example just border_color: 2F8CD8 instead of border_color: 0x2F8CD8, if it's not too difficult...

from esphome.

clydebarrow avatar clydebarrow commented on June 20, 2024

it is difficult, because in YAML 2F8CD8 is a string, and while that could be then converted as a hex number during validation, something like 606060 would be parsed as a decimal number by the YAML parser before it's even seen by a validator, so it would have to be written as "606060" which defeats the purpose. And since a color ID can also be used, how do you tell if fabcde is a hex number or an ID? So I think it's much better to have one consistent and unambigous way of specifying a color rather than shorthands that only work some of the time.

Allowing #606060 would be nice, but # is a comment indicator in YAML so that won't work.

from esphome.

nagyrobi avatar nagyrobi commented on June 20, 2024

Ok, forget this.

from esphome.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.