Giter Club home page Giter Club logo

Comments (4)

asciidisco avatar asciidisco commented on September 17, 2024

I´ve seen this before but totally forgot about it. Indeed your findings seem to be the root of the issue.
Maybe @rodneyrehm has heard about this before and can add something to the discussion?

from dalek.

rodneyrehm avatar rodneyrehm commented on September 17, 2024

While specifications CSS2 Color and CSS3 Color define the computed value to be formatted "as specified", no browser reliably does this at this point.

I'm not sure I like the notion of testing for a given color in the first place. I'd argue that you should be testing for an element being in a given state (certain class name present, data-attribute filled, etc). But if you must check for a specific style, you'll have to deal with the short comings of computedValue() yourself.

For colors I can recommend chromath for working with colors and this SO question might help with creating a fuzzy color compare function

from dalek.

Munter avatar Munter commented on September 17, 2024

I've had to deal with these comparisons myself in the color library I wrote because I use floating point representations internally. This is how I solved it: https://github.com/One-com/one-color#comparing-color-objects

from dalek.

MrOutput avatar MrOutput commented on September 17, 2024

my rgba values don't even work on phantom 3

from dalek.

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.