CN113946262A - Color taking method and device and storage medium - Google Patents

Color taking method and device and storage medium Download PDF

Info

Publication number
CN113946262A
CN113946262A CN202010682475.9A CN202010682475A CN113946262A CN 113946262 A CN113946262 A CN 113946262A CN 202010682475 A CN202010682475 A CN 202010682475A CN 113946262 A CN113946262 A CN 113946262A
Authority
CN
China
Prior art keywords
color
touch
ith
coordinate
mapping
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010682475.9A
Other languages
Chinese (zh)
Other versions
CN113946262B (en
Inventor
吴迪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Mobile Communications Group Co Ltd
China Mobile Suzhou Software Technology Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Suzhou Software Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Mobile Communications Group Co Ltd, China Mobile Suzhou Software Technology Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN202010682475.9A priority Critical patent/CN113946262B/en
Publication of CN113946262A publication Critical patent/CN113946262A/en
Application granted granted Critical
Publication of CN113946262B publication Critical patent/CN113946262B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/04847Interaction techniques to control parameter settings, e.g. interaction with sliders or dials
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/0485Scrolling or panning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0487Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser
    • G06F3/0488Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using a touch-screen or digitiser, e.g. input of commands through traced gestures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/001Texturing; Colouring; Generation of texture or colour

Abstract

The invention discloses a color sampling method, which comprises the following steps: when the fact that the duration of the touch of the first touch point reaches the preset duration in the preset touch area is detected, displaying a color selector in the preset display area; the first touch point is any point in a preset touch area; determining a touch moving area with a first touch point as a center based on the color selection area of the color selector; under the condition that the first touch point is continuously detected to be touched, when a continuous moving track in a touch moving area is detected by taking the first touch point as a starting point, mapping the continuous moving track to a color sampler for color display; and when the touch mobile area is detected not to be touched, stopping displaying the color sampler in the preset display area, and selecting the last color displayed by the color sampler before the display is stopped to determine the last color as the target color. By implementing the scheme, the accuracy and flexibility of color taking are improved.

Description

Color taking method and device and storage medium
Technical Field
The invention relates to the technical field of electronic information, in particular to a color sampling method and device and a storage medium.
Background
Color sampling, also known as color selection, is widely applied to the field of image processing. For portable touch screen devices such as a hand-drawing screen, a tablet computer, and a mobile phone, drawing software is installed, and a user generally needs to perform a touch operation for realizing color extraction when drawing by using the drawing software, so as to select and utilize a desired color.
At present, in the process of drawing by using a portable touch screen device, a color selector needs to be continuously displayed in a specific area displayed on a display interface, when a user selects a color, the user can click an area corresponding to the color selector on a touch screen by using a stylus or a finger, and the device can acquire a coordinate corresponding to a click position in the color selector, so as to identify a color value of the color at the coordinate and further provide corresponding color information.
However, the color selector occupies a large area on the display interface and is always displayed on the display interface, so that not only is misoperation easy to occur, but also a user can select the color only by interrupting other operations, and the color selecting accuracy and flexibility are low.
Disclosure of Invention
In order to solve the above technical problems, it is desirable to provide a color sampling method, a color sampling device, and a storage medium, which flexibly display or hide a color sampler, and allow a user to cooperatively perform color sampling without interrupting other operations, thereby improving accuracy and flexibility of color sampling.
The technical scheme of the invention is realized as follows:
the invention provides a color sampling method, which comprises the following steps:
when the fact that the duration of the touch of the first touch point reaches the preset duration in the preset touch area is detected, displaying a color selector in the preset display area; the first touch point is any point in the preset touch area;
determining a touch moving area with the first touch point as a center based on the color selection area of the color sampler;
under the condition that the first touch point is continuously detected to be touched, when a continuous moving track in the touch moving area is detected with the first touch point as a starting point, mapping the continuous moving track to the color sampler for color display;
and when the touch mobile area is detected not to be touched, stopping displaying the color sampler in the preset display area, and selecting the last color displayed by the color sampler before the display is stopped to determine the last color as the target color.
In the color sampling method, the determining a touch movement area centered on the first touch point based on the color selection area of the color sampler includes:
determining half of the color selection area as a touch moving area;
and determining a touch area with the first touch point as the center and the area as the touch moving area.
In the above color sampling method, the continuous moving trajectory includes at least one moving trajectory connected in sequence, and mapping the continuous moving trajectory to the color sampler for color display includes:
when the ith segment of moving track is mapped, acquiring the (i-1) th touch coordinate and the (i-1) th mapping coordinate corresponding to the end point of the (i-1) th segment of moving track, the ith touch coordinate corresponding to the end point of the ith segment of moving track and the ith track moving duration corresponding to the ith segment of moving track; i is a natural number greater than or equal to 1;
determining an ith mapping coordinate and an ith mapping speed based on the ith-1 touch coordinate, the ith-1 mapping coordinate, the ith track moving time length and the ith touch coordinate;
controlling the marker to move from the ith-1 mapping coordinate to the ith mapping coordinate in the color sampler according to the ith mapping speed, and sequentially amplifying and displaying the color and the color value passed by the marker through an amplifier;
when the ith segment of moving track is not the last segment of moving track in the at least one segment of moving track, continuously mapping the (i + 1) th segment of moving track to the color sampler for color display until the last segment of moving track is mapped to the color sampler for color display.
In the color extraction method, when i is equal to 1, the obtaining of the i-1 st touch coordinate and the i-1 st mapping coordinate corresponding to the end point of the i-1 th movement track includes:
determining the touch coordinate corresponding to the first touch point as a 0 th touch coordinate;
and determining the position coordinate corresponding to the central point of the color sampler as the 0 th mapping coordinate.
In the above color extraction method, the determining an ith mapping coordinate and an ith mapping speed based on the i-1 th touch coordinate, the i-1 th mapping coordinate, the i-th track moving time length, and the i-th touch coordinate includes:
determining the ith mapping coordinate according to the ith-1 touch coordinate, the ith-1 mapping coordinate and the ith touch coordinate;
and determining the ith mapping speed according to the ith-1 touch coordinate, the ith touch coordinate and the ith track moving time length.
The invention provides a color sampling device, comprising:
the display detection module is used for displaying the color selector in the preset display area when the touch duration of the first touch point reaches the preset duration in the preset touch area; the first touch point is any point in the preset touch area;
the area determination module is used for determining a touch moving area taking the first touch point as a center based on the color selection area of the color sampler;
a track mapping module, configured to map, when a continuous moving track in the touch movement area is detected with the first touch point as a starting point under the condition that the first touch point is continuously detected to be touched, the continuous moving track to the color sampler for color display;
and the color selection module is used for stopping displaying the color sampler in the preset display area when the touch mobile area is not touched, selecting the last color displayed by the color sampler before the color sampler is stopped to be displayed, and determining the last color as the target color.
In the color sampling device, the region determining module is specifically configured to determine half of the color selection area as a touch movement area; and determining a touch area with the first touch point as the center and the area as the touch moving area.
In the above color sampling device, the continuous moving track includes at least one moving track section connected in sequence,
the track mapping module is specifically used for acquiring an i-1 th touch coordinate and an i-1 th mapping coordinate corresponding to the end point of the i-1 th moving track, an i-th touch coordinate corresponding to the end point of the i-1 th moving track, and an i-th track moving duration corresponding to the i-th moving track when mapping the i-th moving track; i is a natural number greater than or equal to 1; determining an ith mapping coordinate and an ith mapping speed based on the ith-1 touch coordinate, the ith-1 mapping coordinate, the ith track moving time length and the ith touch coordinate; controlling the marker to move from the ith-1 mapping coordinate to the ith mapping coordinate in the color sampler according to the ith mapping speed, and sequentially amplifying and displaying the color and the color value passed by the marker through an amplifier; when the ith segment of moving track is not the last segment of moving track in the at least one segment of moving track, continuously mapping the (i + 1) th segment of moving track to the color sampler for color display until the last segment of moving track is mapped to the color sampler for color display.
In the above described color sampling device, when i is equal to 1,
the track mapping module is specifically configured to determine a touch coordinate corresponding to the first touch point as a 0 th touch coordinate; and determining the position coordinate corresponding to the central point of the color sampler as the 0 th mapping coordinate.
In the color sampling device, the track mapping module is specifically configured to determine the ith mapping coordinate according to the i-1 th touch coordinate, the i-1 th mapping coordinate, and the ith touch coordinate; and determining the ith mapping speed according to the ith-1 touch coordinate, the ith touch coordinate and the ith track moving time length.
The invention provides a color sampling device, which comprises a processor, a memory and a communication bus;
the communication bus is used for realizing communication connection between the processor and the memory;
the processor is configured to execute one or more programs stored in the memory to implement the color extraction method.
The present invention provides a computer-readable storage medium, characterized in that the computer-readable storage medium stores one or more programs, which can be executed by one or more processors, to implement the above color extraction method.
The invention provides a color sampling method, a color sampling device and a storage medium, wherein the method comprises the following steps: when the fact that the duration of the touch of the first touch point reaches the preset duration in the preset touch area is detected, displaying a color selector in the preset display area; the first touch point is any point in a preset touch area; determining a touch moving area with a first touch point as a center based on the color selection area of the color selector; under the condition that the first touch point is continuously detected to be touched, when a continuous moving track in a touch moving area is detected by taking the first touch point as a starting point, mapping the continuous moving track to a color sampler for color display; and when the touch mobile area is detected not to be touched, stopping displaying the color sampler in the preset display area, and selecting the last color displayed by the color sampler before the display is stopped to determine the last color as the target color. The technical scheme provided by the invention flexibly displays or hides the color extractor, can be used for the user to cooperatively extract the color without interrupting other operations, and improves the accuracy and flexibility of color extraction.
Drawings
Fig. 1 is a schematic flow chart of a color extraction method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of an exemplary color extraction interaction provided by an embodiment of the present invention;
FIG. 3 is a schematic flow chart of mapping a trajectory to achieve color display according to an embodiment of the present invention;
fig. 4 is a first schematic structural diagram of a color sampling device according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a color sampling device according to an embodiment of the present invention.
Detailed Description
The technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
The embodiment of the invention provides a color taking method which is realized by a color taking device. The color sampling device may be an electronic device with a touch screen, such as a hand-drawing screen, a tablet computer, and a mobile phone, and the embodiment of the invention is not limited. Fig. 1 is a schematic flow chart of a color extraction method according to an embodiment of the present invention. As shown in fig. 1, the color extraction method mainly includes the following steps:
s101, when the fact that the duration of the touch of a first touch point in a preset touch area reaches a preset duration is detected, displaying a color selector in a preset display area; the first touch point is any point in a preset touch area.
In the embodiment of the invention, the color selector can perform touch detection on the preset touch area in real time, so that when the touch duration of the first touch point in the preset touch area reaches the preset duration, the color selector is displayed in the preset display area.
It should be noted that, in the embodiment of the present invention, the first touch point is any point in the preset touch area. That is, when the color sampling device detects that the duration of any point in the preset touch area being touched reaches the preset duration, the color sampler can be displayed in the preset display area.
It should be noted that, in the embodiment of the present invention, the preset touch area, the preset duration and the preset display area may be determined according to actual requirements, and the embodiment of the present invention is not limited.
Fig. 2 is an exemplary color-sampling interaction diagram according to an embodiment of the present invention. As shown in fig. 2, in the embodiment of the present invention, the preset touch area is a small area at the lower left of the touch screen, the preset duration is 1 second, and the preset display area is a specific area at the center of the display interface, that is, when the color sampling device detects that the duration of touch on any point in the preset touch area at the lower left of the touch screen reaches 1 second, the color sampler is displayed in the preset display area at the center of the display interface.
It can be understood that, at present, in the drawing process, the color sampler occupies most of the area of the display interface, and is suspended above the working area, thereby not only shielding the working area, but also being easy to be operated by mistake. In the embodiment of the invention, the display and the closing of the color sampler can be flexibly realized, and a smaller preset display area can be set for displaying the color sampler, so that the working area is prevented from being shielded. In addition, the position of the current color extractor is generally at the upper right of the display interface, and a user needs to use the same hand when color extracting and drawing are carried out, so that drawing operation is necessarily interrupted when color extracting is carried out, and two hands cannot work cooperatively, so that drawing efficiency is influenced. In the embodiment of the present invention, the preset touch area may be located at the lower left of the display interface, that is, the user may use the left hand to call the color extractor and extract the color without interrupting the drawing operation.
S102, determining a touch moving area with the first touch point as the center based on the color selection area of the color selector.
In the embodiment of the present invention, the color sampling device may not only display the color sampler in the preset display area, but also determine the touch movement area centered on the first touch point based on the color selection area of the color sampler.
It should be noted that, in the embodiment of the present invention, the color picker includes various colors, and the display area occupied by the color picker is the color picking area. The specific color selection area can be set according to actual requirements, and the embodiment of the invention is not limited.
Specifically, in the embodiment of the present invention, the color extracting device determines the touch moving area centered on the first touch point based on the color selecting area of the color extractor, and includes: determining half of the color selection area as a touch moving area; and determining a touch area with the first touch point as the center and the area as the touch moving area.
It is understood that, in the embodiment of the present invention, the touch movement area is a range in which the user's finger can perform touch movement. For example, if the color selection area of the color selector is N, the touch moving area is a touch area with an area of N/2 centered on the first touch point, and the user's finger can move within the touch moving area to realize color selection.
S103, under the condition that the first touch point is continuously detected to be touched, when a continuous moving track in the touch moving area with the first touch point as a starting point is detected, the continuous moving track is mapped to the color sampler for color display.
In an embodiment of the present invention, after the color extractor is displayed in the preset display area, when the first touch point is continuously detected to be touched, and when a continuous moving track in the touch moving area is detected with the first touch point as a starting point, the color extractor maps the continuous moving track to the color extractor for color display.
It should be noted that, in the embodiment of the present invention, the color obtaining device displays the color obtaining device in the preset display area when the duration of the first touch point being touched reaches the preset duration, and then, when performing color obtaining, firstly, the first touch point needs to be kept being touched continuously, and then, the continuous moving track in the touch area is further detected to be mapped to the color obtaining device for performing color display.
Specifically, in the embodiment of the present invention, the continuous movement trajectory includes at least one section of movement trajectory connected in series. Fig. 3 is a schematic flowchart of mapping a track to achieve color display according to an embodiment of the present invention. As shown in fig. 3, the color sampler maps the continuous moving track to the color sampler for color display, and the method mainly includes the following steps:
s301, when mapping the ith segment of moving track, acquiring the (i-1) th touch coordinate corresponding to the end point of the (i-1) th segment of moving track, the (i-1) th mapping coordinate corresponding to the end point of the ith segment of moving track, and the movement duration of the ith track corresponding to the ith segment of moving track; i is a natural number of 1 or more.
In the embodiment of the invention, when mapping the ith segment of moving track in at least one segment of moving track connected in sequence to the color sampler, the color sampling device needs to first obtain the (i-1) th touch coordinate corresponding to the end point of the (i-1) th segment of moving track, the (i-1) th mapping coordinate, the (i) th touch coordinate corresponding to the end point of the (i) th segment of moving track, and the (i) th track moving time length corresponding to the (i) th segment of moving track.
It can be understood that, in the embodiment of the present invention, when the user selects the color, the user performs the touch movement operation in the touch movement area with the first touch point as the starting point, so that the color sampling device can detect the continuous movement track in the touch movement area. Because the user can stay for a period of time after moving once, and check whether the color and the color value displayed at the position mapped in the color taking device meet the requirements, in fact, after moving once, an end point exists, and the color taking device can directly detect the touch coordinate corresponding to the end point of each section of moving track after moving every time, namely, the ith touch coordinate can be directly detected.
It should be noted that, in the embodiment of the present invention, when i is not equal to 1, when mapping the ith moving track, the i-1 st touch coordinate and the i-1 st mapping coordinate corresponding to the end point of the i-1 st moving track may be obtained in the process of mapping the ith-1 st moving track. When i is equal to 1, acquiring the i-1 st touch coordinate and the i-1 st mapping coordinate corresponding to the end point of the i-1 th movement track, wherein the acquiring comprises the following steps: determining the touch coordinate corresponding to the first touch point as a 0 th touch coordinate; and determining the position coordinate corresponding to the central point of the color sampler as the 0 th mapping coordinate.
It can be understood that, in the embodiment of the present invention, when i is equal to 1, the color obtaining device has not previously performed mapping of the movement track, and there is no movement track in the previous segment, which is actually an initial condition, therefore, the touch coordinate corresponding to the first touch point, that is, the starting point, may be determined as the 0 th touch coordinate, and correspondingly, the position coordinate corresponding to the center point of the color obtaining device may be determined as the 0 th mapping coordinate. That is, the center point of the color sampler actually corresponds to the first touch point one by one, and the first touch point is mapped to a point in the color sampler, that is, the center point of the color sampler.
S302, determining the ith mapping coordinate and the ith mapping speed based on the ith-1 touch coordinate, the ith-1 mapping coordinate, the ith track moving time length and the ith touch coordinate.
In the embodiment of the invention, the color sampling device obtains the (i-1) th touch coordinate, the (i-1) th mapping coordinate, the ith track moving time length and the ith touch coordinate, and further determines the ith mapping coordinate and the ith mapping speed based on the (i-1) th touch coordinate, the (i-1) th mapping coordinate, the ith track moving time length and the ith touch coordinate.
Specifically, in the embodiment of the present invention, the determining, by the color sampling device, the ith mapping coordinate and the ith mapping speed based on the i-1 th touch coordinate, the i-1 th mapping coordinate, the ith track movement time length and the ith touch coordinate includes: determining the ith mapping coordinate according to the ith-1 touch coordinate, the ith-1 mapping coordinate and the ith touch coordinate; and determining the ith mapping speed according to the ith-1 touch coordinate, the ith touch coordinate and the ith track moving time length.
Specifically, in the embodiment of the present invention, the i-1 st touch coordinate is (x0, y0), the i-th touch coordinate is (x1, y1), and the i-1 st mapping coordinate is (x2, y2), and the i-th mapping coordinate (x3, y3) can be determined according to the following distance mapping formula (1):
Figure BDA0002586347450000091
it is understood that, in the embodiment of the present invention, the distance corresponding to each segment of the moving track in the color picker is half of the distance of the moving track.
Specifically, in the embodiment of the present invention, the ith-1 touch coordinate is (x0, y0), the ith touch coordinate is (x1, y1), the ith track moving time length is Ti, and the ith mapping speed Vi can be determined according to the following moving speed mapping formula (2):
Figure BDA0002586347450000092
it is understood that, in the embodiment of the present invention, the mapping speed of each segment of the moving track in the color sampler is half of the moving speed of the moving track.
It should be noted that, in the embodiment of the present invention, the manner of determining the ith mapping coordinate and the ith mapping speed is only an exemplary manner, and of course, other mapping relationships may also be used for determination, and the embodiment of the present invention is not limited.
S303, controlling the marker to move from the (i-1) th mapping coordinate to the (i) th mapping coordinate in the color sampler according to the (i) th mapping speed, and amplifying and displaying the color and the color value passed by the marker in sequence through an amplifier.
In the embodiment of the invention, after the color sampling device determines the ith mapping speed and the (i-1) th mapping coordinate, the marker is controlled to move from the (i-1) th mapping coordinate to the ith mapping coordinate in the color sampling device according to the ith mapping speed, and the color value passed by the marker are sequentially displayed in an amplifying mode through the amplifier.
It can be understood that, in the embodiment of the present invention, the ith moving track actually corresponds to the movement from the end point of the ith-1 moving track to the end point of the ith moving track, therefore, the color taking device obtains the ith-1 mapping coordinate corresponding to the end point of the ith-1 moving track, and determines the ith mapping coordinate corresponding to the end point of the ith moving track, and the ith mapping speed, that is, according to the ith mapping speed, the marker is controlled in the color taking device to move from the ith-1 mapping coordinate to the ith mapping coordinate, and the passed color and the color value are sequentially displayed in an amplifier in an enlarged manner.
In the embodiment of the present invention, as shown in fig. 2, the color sampler includes a marker, which can be moved, and when the marker is at a certain position of the color sampler, the color and the color value corresponding to the certain position can be displayed in an enlarged manner through an amplifier.
It can be understood that, in the embodiment of the present invention, the color extracting device controls the marker to move from the i-1 th mapping coordinate to the i-th mapping coordinate in the color extractor according to the i-th mapping speed, and may pass through a plurality of positions in the plurality of color extractors, and there is a corresponding color and color value for each position, so that the color extracting device may sequentially display the color and color value passed by the marker through an amplifier in an enlarged manner, so as to facilitate a user to see the color and the color value corresponding to the color more clearly.
S304, when the ith moving track is not the last moving track in the at least one moving track, continuously mapping the (i + 1) th moving track to the color sampler for color display until the last moving track is mapped to the color sampler for color display.
In the embodiment of the invention, the color sampling device controls the marker to move from the i-1 th mapping coordinate to the i-th mapping coordinate in the color sampler according to the i-th mapping speed, and the color value passed by the marker are sequentially amplified and displayed through the amplifier, namely the mapping of the i-th section of moving track is completed, and the color display in the color sampler is realized. And then, when the ith section of moving track is not the last section of moving track in the at least one section of moving track, continuously mapping the (i + 1) th section of moving track to the color sampler for color display until the last section of moving track is mapped to the color sampler for color display.
It can be understood that, in the embodiment of the present invention, the process of mapping the i +1 th segment of the moving track to the color sampler for color display is the same as the manner of mapping the i th segment of the moving track to the color sampler for color display, and details are not repeated herein.
And S104, when the touch mobile area is detected not to be touched, stopping displaying the color sampler in the preset display area, and selecting the last color displayed by the color sampler before the color sampler is stopped to be determined as the target color.
In the embodiment of the present invention, when the color sampling device detects that the touch-control moving area is not touched, the display of the color sampler in the preset display area is stopped, and the last color displayed by the color sampler before the display is stopped is selected and determined as the target color.
It can be understood that, in the embodiment of the present invention, the touch-controlled moving area is touched, which represents that the finger or the stylus of the user has left the touch-controlled moving area, and at this time, the display of the color selector in the preset display area may be stopped, so as to avoid the shielding of the drawing area by the color selector in the subsequent drawing process.
It should be noted that, in the embodiment of the present invention, the last color displayed by the color extractor before the display is stopped is actually the color that needs to be selected and determined by the user, so that when the color extractor stops displaying in the preset display area, the color extractor may select and determine the last color displayed before the display is stopped as the target color for the user to use in the drawing process.
It can be understood that, in the embodiment of the present invention, after the color sampling device stops displaying the color sampler in the preset display area, the color sampling device may continue to continuously detect whether the duration of any point touched in the preset touch area reaches the preset duration, so that when the duration of any point touched reaches the preset duration, the color sampler is displayed in the preset display area again. That is, the color sampling device can realize flexible control of display and stop of display.
The invention provides a color sampling method, which comprises the following steps: when the fact that the duration of the touch of the first touch point reaches the preset duration in the preset touch area is detected, displaying a color selector in the preset display area; the first touch point is any point in a preset touch area; determining a touch moving area with a first touch point as a center based on the color selection area of the color selector; under the condition that the first touch point is continuously detected to be touched, when a continuous moving track in a touch moving area is detected by taking the first touch point as a starting point, mapping the continuous moving track to a color sampler for color display; and when the touch mobile area is detected not to be touched, stopping displaying the color sampler in the preset display area, and selecting the last color displayed by the color sampler before the display is stopped to determine the last color as the target color. The technical scheme provided by the invention flexibly displays or hides the color extractor, can be used for the user to cooperatively extract the color without interrupting other operations, and improves the accuracy and flexibility of color extraction.
The embodiment of the invention provides a color taking device. Fig. 4 is a first schematic structural diagram of a color sampling device according to an embodiment of the present invention. As shown in fig. 4, the apparatus includes:
the display detection module 401 is configured to display a color selector in a preset display area when it is detected that a duration of the first touch point being touched reaches a preset duration in the preset touch area; the first touch point is any point in the preset touch area;
a region determining module 402, configured to determine a touch moving region centered on the first touch point based on a color selection area of the color sampler;
a track mapping module 403, configured to, when it is detected that the first touch point is touched continuously, when a continuous moving track in the touch moving area is detected with the first touch point as a starting point, map the continuous moving track to the color sampler for color display;
and a color selecting module 404, configured to, when it is detected that the touch-controlled moving area is not touched, stop displaying the color sampler in the preset display area, and select a last color displayed by the color sampler before the display is stopped, so as to determine the last color as a target color.
In the above apparatus, the area determining module 402 is specifically configured to determine a half of the color selection area as a touch movement area; and determining a touch area with the first touch point as the center and the area as the touch moving area.
In the above apparatus, the continuous moving trajectory includes at least one moving trajectory connected in series,
the track mapping module 403 is specifically configured to, when mapping an ith segment of moving track, obtain an ith-1 touch coordinate and an ith-1 mapping coordinate corresponding to an end point of the ith-1 segment of moving track, an ith touch coordinate corresponding to an end point of the ith segment of moving track, and an ith track moving duration corresponding to the ith segment of moving track; i is a natural number greater than or equal to 1; determining an ith mapping coordinate and an ith mapping speed based on the ith-1 touch coordinate, the ith-1 mapping coordinate, the ith track moving time length and the ith touch coordinate; controlling the marker to move from the ith-1 mapping coordinate to the ith mapping coordinate in the color sampler according to the ith mapping speed, and sequentially amplifying and displaying the color and the color value passed by the marker through an amplifier; when the ith segment of moving track is not the last segment of moving track in the at least one segment of moving track, continuously mapping the (i + 1) th segment of moving track to the color sampler for color display until the last segment of moving track is mapped to the color sampler for color display.
In the above-described device, when i is equal to 1,
the track mapping module 403 is specifically configured to determine a touch coordinate corresponding to the first touch point as a 0 th touch coordinate; and determining the position coordinate corresponding to the central point of the color sampler as the 0 th mapping coordinate.
In the above apparatus, the track mapping module 403 is specifically configured to determine the ith mapping coordinate according to the i-1 th touch coordinate, the i-1 th mapping coordinate, and the ith touch coordinate; and determining the ith mapping speed according to the ith-1 touch coordinate, the ith touch coordinate and the ith track moving time length.
Fig. 5 is a schematic structural diagram of a color sampling device according to an embodiment of the present invention. As shown in fig. 5, the color sampling device includes a processor 501, a memory 502 and a communication bus 503;
the communication bus 503 is used for realizing communication connection between the processor 501 and the memory 502;
the processor 501 is configured to execute one or more programs stored in the memory 502 to implement the color extraction method.
The invention provides a color sampling device, which is characterized in that when the fact that the duration of touch of a first touch point reaches the preset duration in a preset touch area is detected, a color sampler is displayed in a preset display area; the first touch point is any point in a preset touch area; determining a touch moving area with a first touch point as a center based on the color selection area of the color selector; under the condition that the first touch point is continuously detected to be touched, when a continuous moving track in a touch moving area is detected by taking the first touch point as a starting point, mapping the continuous moving track to a color sampler for color display; and when the touch mobile area is detected not to be touched, stopping displaying the color sampler in the preset display area, and selecting the last color displayed by the color sampler before the display is stopped to determine the last color as the target color. The color taking device provided by the invention flexibly displays or hides the color taking device, can be used for users to cooperatively take colors under the condition of not interrupting other operations, and improves the accuracy and flexibility of color taking.
The present invention also provides a computer-readable storage medium storing one or more programs, which are executable by one or more processors to implement the above-described color extraction method. The computer-readable storage medium may be a volatile Memory (volatile Memory), such as a Random-Access Memory (RAM); or a non-volatile Memory (non-volatile Memory), such as a Read-Only Memory (ROM), a flash Memory (flash Memory), a Hard Disk (Hard Disk Drive, HDD) or a Solid-State Drive (SSD); or may be a respective device, such as a mobile phone, computer, tablet device, personal digital assistant, etc., that includes one or any combination of the above-mentioned memories.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of a hardware embodiment, a software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above description is only a preferred embodiment of the present invention, and is not intended to limit the scope of the present invention.

Claims (12)

1. A method of color extraction, the method comprising:
when the fact that the duration of the touch of the first touch point reaches the preset duration in the preset touch area is detected, displaying a color selector in the preset display area; the first touch point is any point in the preset touch area;
determining a touch moving area with the first touch point as a center based on the color selection area of the color sampler;
under the condition that the first touch point is continuously detected to be touched, when a continuous moving track in the touch moving area is detected with the first touch point as a starting point, mapping the continuous moving track to the color sampler for color display;
and when the touch mobile area is detected not to be touched, stopping displaying the color sampler in the preset display area, and selecting the last color displayed by the color sampler before the display is stopped to determine the last color as the target color.
2. The method of claim 1, wherein determining the touch movement area centered at the first touch point based on the color selection area of the color selector comprises:
determining half of the color selection area as a touch moving area;
and determining a touch area with the first touch point as the center and the area as the touch moving area.
3. The method of claim 1, wherein the continuous moving track comprises at least one moving track segment connected in sequence, and the mapping the continuous moving track into the color extractor for color display comprises:
when the ith segment of moving track is mapped, acquiring the (i-1) th touch coordinate and the (i-1) th mapping coordinate corresponding to the end point of the (i-1) th segment of moving track, the ith touch coordinate corresponding to the end point of the ith segment of moving track and the ith track moving duration corresponding to the ith segment of moving track; i is a natural number greater than or equal to 1;
determining an ith mapping coordinate and an ith mapping speed based on the ith-1 touch coordinate, the ith-1 mapping coordinate, the ith track moving time length and the ith touch coordinate;
controlling the marker to move from the ith-1 mapping coordinate to the ith mapping coordinate in the color sampler according to the ith mapping speed, and sequentially amplifying and displaying the color and the color value passed by the marker through an amplifier;
when the ith segment of moving track is not the last segment of moving track in the at least one segment of moving track, continuously mapping the (i + 1) th segment of moving track to the color sampler for color display until the last segment of moving track is mapped to the color sampler for color display.
4. The method according to claim 3, wherein when i is equal to 1, the obtaining of the i-1 st touch coordinate and the i-1 st mapping coordinate corresponding to the end point of the i-1 st movement track comprises:
determining the touch coordinate corresponding to the first touch point as a 0 th touch coordinate;
and determining the position coordinate corresponding to the central point of the color sampler as the 0 th mapping coordinate.
5. The method of claim 3, wherein determining the ith mapping coordinate and the ith mapping speed based on the i-1 st touch coordinate, the i-1 st mapping coordinate, the ith track movement time length and the ith touch coordinate comprises:
determining the ith mapping coordinate according to the ith-1 touch coordinate, the ith-1 mapping coordinate and the ith touch coordinate;
and determining the ith mapping speed according to the ith-1 touch coordinate, the ith touch coordinate and the ith track moving time length.
6. A color sampling apparatus, comprising:
the display detection module is used for displaying the color selector in the preset display area when the touch duration of the first touch point reaches the preset duration in the preset touch area; the first touch point is any point in the preset touch area;
the area determination module is used for determining a touch moving area taking the first touch point as a center based on the color selection area of the color sampler;
a track mapping module, configured to map, when a continuous moving track in the touch movement area is detected with the first touch point as a starting point under the condition that the first touch point is continuously detected to be touched, the continuous moving track to the color sampler for color display;
and the color selection module is used for stopping displaying the color sampler in the preset display area when the touch mobile area is not touched, selecting the last color displayed by the color sampler before the color sampler is stopped to be displayed, and determining the last color as the target color.
7. The apparatus of claim 6,
the area determination module is specifically configured to determine a half of the color selection area as a touch movement area; and determining a touch area with the first touch point as the center and the area as the touch moving area.
8. The apparatus of claim 6, wherein the continuous movement trace comprises at least one segment of movement trace connected in sequence,
the track mapping module is specifically used for acquiring an i-1 th touch coordinate and an i-1 th mapping coordinate corresponding to the end point of the i-1 th moving track, an i-th touch coordinate corresponding to the end point of the i-1 th moving track, and an i-th track moving duration corresponding to the i-th moving track when mapping the i-th moving track; i is a natural number greater than or equal to 1; determining an ith mapping coordinate and an ith mapping speed based on the ith-1 touch coordinate, the ith-1 mapping coordinate, the ith track moving time length and the ith touch coordinate; controlling the marker to move from the ith-1 mapping coordinate to the ith mapping coordinate in the color sampler according to the ith mapping speed, and sequentially amplifying and displaying the color and the color value passed by the marker through an amplifier; when the ith segment of moving track is not the last segment of moving track in the at least one segment of moving track, continuously mapping the (i + 1) th segment of moving track to the color sampler for color display until the last segment of moving track is mapped to the color sampler for color display.
9. The apparatus of claim 8, wherein when i equals 1,
the track mapping module is specifically configured to determine a touch coordinate corresponding to the first touch point as a 0 th touch coordinate; and determining the position coordinate corresponding to the central point of the color sampler as the 0 th mapping coordinate.
10. The apparatus of claim 8,
the track mapping module is specifically configured to determine the ith mapping coordinate according to the i-1 th touch coordinate, the i-1 th mapping coordinate, and the ith touch coordinate; and determining the ith mapping speed according to the ith-1 touch coordinate, the ith touch coordinate and the ith track moving time length.
11. A color sampling apparatus, comprising a processor, a memory, and a communication bus;
the communication bus is used for realizing communication connection between the processor and the memory;
the processor is configured to execute one or more programs stored in the memory to implement the color sampling method according to any one of claims 1 to 5.
12. A computer-readable storage medium storing one or more programs, the one or more programs being executable by one or more processors to implement the color extraction method of any one of claims 1-5.
CN202010682475.9A 2020-07-15 2020-07-15 Color taking method and device and storage medium Active CN113946262B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010682475.9A CN113946262B (en) 2020-07-15 2020-07-15 Color taking method and device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010682475.9A CN113946262B (en) 2020-07-15 2020-07-15 Color taking method and device and storage medium

Publications (2)

Publication Number Publication Date
CN113946262A true CN113946262A (en) 2022-01-18
CN113946262B CN113946262B (en) 2024-04-09

Family

ID=79326116

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010682475.9A Active CN113946262B (en) 2020-07-15 2020-07-15 Color taking method and device and storage medium

Country Status (1)

Country Link
CN (1) CN113946262B (en)

Citations (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5249263A (en) * 1989-06-16 1993-09-28 International Business Machines Corporation Color palette display interface for a computer-based image editor
JP2000268158A (en) * 1999-03-15 2000-09-29 Sony Corp Image processor and image processing method
US20130093782A1 (en) * 2011-10-13 2013-04-18 Microsoft Corporation Color Selection and Chart Styles
CN104850333A (en) * 2015-04-29 2015-08-19 深圳市金立通信设备有限公司 Interface operating method
CN104850432A (en) * 2015-04-29 2015-08-19 小米科技有限责任公司 Method and device for adjusting color
CN105279778A (en) * 2015-10-12 2016-01-27 深圳市金立通信设备有限公司 Method and terminal for picture color filling
US20160262239A1 (en) * 2015-03-06 2016-09-08 Jonathan Robert Hole Color Control and Mixing Using Image Picking
CN106033305A (en) * 2015-03-20 2016-10-19 广州金山移动科技有限公司 Screen color picking method and device
CN106775374A (en) * 2016-11-17 2017-05-31 广州视源电子科技股份有限公司 Color acquisition methods and device based on touch-screen
US20170255378A1 (en) * 2016-03-02 2017-09-07 Airwatch, Llc Systems and methods for performing erasures within a graphical user interface
CN107219968A (en) * 2017-05-10 2017-09-29 惠州Tcl移动通信有限公司 A kind of drafting method, system, mobile terminal and readable storage medium storing program for executing
CN107422937A (en) * 2017-04-18 2017-12-01 广州视睿电子科技有限公司 The method, apparatus, equipment and storage medium of color are taken on a graphical user interface
CN107463349A (en) * 2017-07-01 2017-12-12 广州视源电子科技股份有限公司 Colour disk method for building up and color localization method
CN108628531A (en) * 2018-04-19 2018-10-09 广州视源电子科技股份有限公司 Method, apparatus, electronic equipment, storage medium and the smart pen for taking color to write
CN109671133A (en) * 2018-12-12 2019-04-23 成都四方伟业软件股份有限公司 Generation method, device, electronic equipment and the storage medium of track
KR102014363B1 (en) * 2019-03-07 2019-08-26 스튜디오씨드코리아 주식회사 Method and apparatus for color extraction using an eye dropper tool whose magnification is changed
CN110244870A (en) * 2019-05-08 2019-09-17 深圳市战音科技有限公司 A kind of electronic drawing board copying method and relevant device
US20190354265A1 (en) * 2018-05-15 2019-11-21 Adobe Inc. Color Picker
CN210983366U (en) * 2019-08-26 2020-07-10 未来创建(深圳)科技有限公司 Portable electronic color-taking plate and computer drawing system

Patent Citations (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5249263A (en) * 1989-06-16 1993-09-28 International Business Machines Corporation Color palette display interface for a computer-based image editor
JP2000268158A (en) * 1999-03-15 2000-09-29 Sony Corp Image processor and image processing method
US20130093782A1 (en) * 2011-10-13 2013-04-18 Microsoft Corporation Color Selection and Chart Styles
US20160262239A1 (en) * 2015-03-06 2016-09-08 Jonathan Robert Hole Color Control and Mixing Using Image Picking
CN106033305A (en) * 2015-03-20 2016-10-19 广州金山移动科技有限公司 Screen color picking method and device
CN104850333A (en) * 2015-04-29 2015-08-19 深圳市金立通信设备有限公司 Interface operating method
CN104850432A (en) * 2015-04-29 2015-08-19 小米科技有限责任公司 Method and device for adjusting color
CN105279778A (en) * 2015-10-12 2016-01-27 深圳市金立通信设备有限公司 Method and terminal for picture color filling
US20170255378A1 (en) * 2016-03-02 2017-09-07 Airwatch, Llc Systems and methods for performing erasures within a graphical user interface
CN106775374A (en) * 2016-11-17 2017-05-31 广州视源电子科技股份有限公司 Color acquisition methods and device based on touch-screen
CN107422937A (en) * 2017-04-18 2017-12-01 广州视睿电子科技有限公司 The method, apparatus, equipment and storage medium of color are taken on a graphical user interface
CN107219968A (en) * 2017-05-10 2017-09-29 惠州Tcl移动通信有限公司 A kind of drafting method, system, mobile terminal and readable storage medium storing program for executing
CN107463349A (en) * 2017-07-01 2017-12-12 广州视源电子科技股份有限公司 Colour disk method for building up and color localization method
CN108628531A (en) * 2018-04-19 2018-10-09 广州视源电子科技股份有限公司 Method, apparatus, electronic equipment, storage medium and the smart pen for taking color to write
US20190354265A1 (en) * 2018-05-15 2019-11-21 Adobe Inc. Color Picker
CN109671133A (en) * 2018-12-12 2019-04-23 成都四方伟业软件股份有限公司 Generation method, device, electronic equipment and the storage medium of track
KR102014363B1 (en) * 2019-03-07 2019-08-26 스튜디오씨드코리아 주식회사 Method and apparatus for color extraction using an eye dropper tool whose magnification is changed
CN110244870A (en) * 2019-05-08 2019-09-17 深圳市战音科技有限公司 A kind of electronic drawing board copying method and relevant device
CN210983366U (en) * 2019-08-26 2020-07-10 未来创建(深圳)科技有限公司 Portable electronic color-taking plate and computer drawing system

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
EUNJIN KIM ET AL.: "Thoughts and Tools for Crafting Colors: Implications from Designers\' Behavior", 《PROCEEDINGS OF THE 2017 CONFERENCE ON DESIGNING INTERACTIVE SYSTEMS》 *
GHITA JALAL ET AL.: "Color Portraits: From Color Picking to Interacting with Color", 《PROCEEDINGS OF THE 33RD ANNUAL ACM CONFERENCE ON HUMAN FACTORS IN COMPUTING SYSTEMS》 *
呼啸长风: "实用型ColorPicker的设计与实现", Retrieved from the Internet <URL:https://juejin.cn/post/6844903908364697613> *
徐尤华等: "多颜色空间取色器的设计与实现", 《微型电脑应用》, vol. 2014, no. 12 *

Also Published As

Publication number Publication date
CN113946262B (en) 2024-04-09

Similar Documents

Publication Publication Date Title
CN109982756B (en) Information processing program, information processing method, and information processing apparatus
CN103914260B (en) Control method and device for operation object based on touch screen
CN107122119B (en) Information processing method, information processing device, electronic equipment and computer readable storage medium
CN108064368A (en) The control method and device of flexible display device
JP6418299B1 (en) Information processing apparatus and program
EP2835729A1 (en) Method for controlling position of floating window and terminal
CN108037888B (en) Skill control method, skill control device, electronic equipment and storage medium
CN103959211B (en) Terminal and the changing method at application function interface
TW201604719A (en) Method and apparatus of controlling a smart device
CN107704157B (en) Multi-screen interface operation method and device and storage medium
CN105511781A (en) Starting application program method, device and user device
US20240077948A1 (en) Gesture-based display interface control method and apparatus, device and storage medium
KR101891306B1 (en) Method and Apparatus for Realizaing Human-Machine Interaction
CN108073267B (en) Three-dimensional control method and device based on motion trail
CN105446629A (en) Content pane switching method, device and terminal
JP2019051297A (en) Information processing device and program
CN113946262B (en) Color taking method and device and storage medium
WO2018191084A1 (en) Continued selection during scrolling
CN107908331A (en) The display control method and electronic equipment of a kind of desktop icons
CN104750412A (en) Method for controlling display interfaces
CN105302466B (en) A kind of text operation method and terminal
CN104750356A (en) Mobile terminal
CN114564134A (en) Application icon display method and device
CN113923392A (en) Video recording method, video recording device and electronic equipment
CN107643821B (en) Input control method and device and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant