| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- // @ts-check
- // Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
- // This file is automatically generated. DO NOT EDIT
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
- // @ts-ignore: Unused imports
- import { Create as $Create } from "@wailsio/runtime";
- /**
- * RGBA represents a traditional 32-bit alpha-premultiplied color, having 8
- * bits for each of red, green, blue and alpha.
- *
- * An alpha-premultiplied color component C has been scaled by alpha (A), so
- * has valid values 0 <= C <= A.
- */
- export class RGBA {
- /**
- * Creates a new RGBA instance.
- * @param {Partial<RGBA>} [$$source = {}] - The source object to create the RGBA.
- */
- constructor($$source = {}) {
- if (!("R" in $$source)) {
- /**
- * @member
- * @type {number}
- */
- this["R"] = 0;
- }
- if (!("G" in $$source)) {
- /**
- * @member
- * @type {number}
- */
- this["G"] = 0;
- }
- if (!("B" in $$source)) {
- /**
- * @member
- * @type {number}
- */
- this["B"] = 0;
- }
- if (!("A" in $$source)) {
- /**
- * @member
- * @type {number}
- */
- this["A"] = 0;
- }
- Object.assign(this, $$source);
- }
- /**
- * Creates a new RGBA instance from a string or object.
- * @param {any} [$$source = {}]
- * @returns {RGBA}
- */
- static createFrom($$source = {}) {
- let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
- return new RGBA(/** @type {Partial<RGBA>} */($$parsedSource));
- }
- }
|