Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slider Label and Value feature, rgba and kelvin color fixes #6

Open
wants to merge 8 commits into
base: typescript
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

Core package for iro.js (WIP)

This is for functionality that can be shared between the standalone version of iro.js as well as the upcoming React and Vue components.
This is for functionality that can be shared between the standalone version of iro.js as well as the upcoming React and Vue components.
3 changes: 3 additions & 0 deletions dist/color.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@ export interface HslColor {
}
export interface KelvinColor {
kelvin: number;
_kelvin: number;
}
export declare type IroColorValue = IroColor | HsvColor | RgbColor | HslColor | KelvinColor | string;
export declare class IroColor {
private $;
private onChange;
private initialValue;
index: number;
_kelvin: number;
/**
* @constructor Color object
* @param value - initial color value
Expand Down Expand Up @@ -112,6 +114,7 @@ export declare class IroColor {
set blue(value: number);
get rgb(): RgbColor;
set rgb(value: RgbColor);
get raw_rgb(): RgbColor;
get rgba(): RgbColor;
set rgba(value: RgbColor);
get hsl(): HslColor;
Expand Down
1 change: 1 addition & 0 deletions dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export * from './color';
export * from './slider';
export * from './input';
export * from './wheel';
export * from './box';
export * from './util';
Expand Down
37 changes: 37 additions & 0 deletions dist/input.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { IroColor } from './color';
import { SliderType } from './slider';
import { IroColorPickerOptions } from './colorPickerOptions';
export interface InputOptions extends IroColorPickerOptions {
color: IroColor;
sliderType: SliderType;
sliderSize: number;
minTemperature: number;
maxTemperature: number;
}
/**
* @desc Get input field dimensions
* @param props - InputOptions
*/
export declare function getInputDimensions(props: Partial<InputOptions>): {
inputWidth: number;
inputHeight: number;
fontSize: number;
};
/**
* @desc Clamp slider value between min and max values
* @param type - props.sliderType
* @param value - value to clamp
*/
export declare function clampSliderValue(props: Partial<InputOptions>, value: number): number;
/**
* @desc Get the current slider value from input field input
* @param props - slider props
* @param e - KeyboardEvent
*/
export declare function getSliderValueFromInputField(e: KeyboardEvent): number;
/**
* @desc Get the current slider value from clipboard data
* @param props - slider props
* @param e - ClipboardEvent
*/
export declare function getSliderValueFromClipboard(props: Partial<InputOptions>, e: ClipboardEvent): number;
Loading