/** * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * Utility methods for color science constants and color space * conversions that aren't HCT or CAM16. */ /** * Standard white point; white on a sunny day. */ export declare const WHITE_POINT_D65: number[]; /** * @param argb ARGB representation of a color. * @return The alpha of the color, from 0 to 255. */ export declare const alphaFromInt: (argb: number) => number; /** * @param argb ARGB representation of a color. * @return The red channel of the color, from 0 to 255. */ export declare const redFromInt: (argb: number) => number; /** * @param argb ARGB representation of a color. * @return The green channel of the color, from 0 to 255. */ export declare const greenFromInt: (argb: number) => number; /** * @param argb ARGB representation of a color. * @return The blue channel of the color, from 0 to 255. */ export declare const blueFromInt: (argb: number) => number; /** * @param argb ARGB representation of a color. * @return L*, from L*a*b*, coordinate of the color. */ export declare const lstarFromInt: (argb: number) => number; /** * @param argb ARGB representation of a color. * @return Hex string representing color, ex. #ff0000 for red. */ export declare const hexFromInt: (argb: number) => string; /** * @param argb ARGB representation of a color. * @return Color's coordinates in the XYZ color space. */ export declare const xyzFromInt: (argb: number) => number[]; /** * @param rgb Array with 3 components between 0 and 255, representing red, * green, and blue. * @return ARGB representation of the color. */ export declare const intFromRgb: (rgb: number[]) => number; /** * @param argb ARGB representation of a color. * @return Color's coordinates in the L*a*b* color space. */ export declare const labFromInt: (argb: number) => number[]; /** * @return ARGB representation of color in the L*a*b* color space. */ export declare const intFromLab: (l: number, a: number, b: number) => number; /** * @return ARGB representation of color in the XYZ color space. */ export declare const intFromXyzComponents: (x: number, y: number, z: number) => number; /** * @return ARGB representation of color in the XYZ color space. */ export declare const intFromXyz: (xyz: number[]) => number; /** * @param hex String representing color as hex code. Accepts strings with or * without leading #, and string representing the color using 3, 6, or 8 * hex characters. * @return ARGB representation of color. */ export declare const intFromHex: (hex: string) => number; /** * @param lstar L* in L*a*b* * @return ARGB representation of grayscale color with lightness matching L* */ export declare const intFromLstar: (lstar: number) => number; /** * L* in L*a*b* and Y in XYZ measure the same quantity, luminance. * L* measures perceptual luminance, a linear scale. * Y in XYZ measures relative luminance, a logarithmic scale. * @param lstar L* in L*a*b* * @return Y in XYZ */ export declare const yFromLstar: (lstar: number) => number; /** * @param rgb 0.0 <= rgb <= 1.0, represents R/G/B channel * @return color channel converted to linear RGB space */ export declare const linearized: (rgb: number) => number; /** * @param rgb 0.0 <= rgb <= 1.0, represents linear R/G/B channel * @return color channel converted to regular RGB space */ export declare const delinearized: (rgb: number) => number;