chromium/third_party/blink/renderer/core/css/cssom/css_color_value.idl

// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// CSSColorValue is the base class used for the various CSS color interfaces.
// It can be used to convert between color spaces.
// https://drafts.css-houdini.org/css-typed-om-1/#colorvalue-objects
[
    Exposed=(Window,LayoutWorklet,PaintWorklet),
    RuntimeEnabled=CSSColorTypedOM
] interface CSSColorValue {
  CSSRGB toRGB();
  CSSHSL toHSL();
  CSSHWB toHWB();

  [RaisesException, NewObject, Exposed=Window, CallWith=ExecutionContext] static (CSSColorValue or CSSStyleValue) parse(USVString cssText);
};